1.5.7895

Mid Dec - assembly ref by name/path

C# Scripting - added ability to reference assemblies by path/name

For several months we've had the feature in scripts, which allows to reference nuget packages

csharp
#r "nuget: Coroutine, 2.1.5"

Log.Info("Hello, World!"); //you can use Coroutine classes in that script

The support has not been extended and you can reference assemblies in 2 other ways now. Important! This method of referencing assemblies is available only inside Script.csx which is equivalent of your Program.cs in "normal" C#

By assembly path - from file

Syntax is very similar.

csharp
#r "assemblyPath: D:\Work\EAExile\EAExileAgent.Shared.dll"

Log.Info("Hello, World!"); //you can use EAExileAgent classes in that script

By assembly name

This method of referencing assemblies allows you to reference those assemblies which are either:

  • already loaded by EyeAuras, but have not been included into default referenced assemblies list
  • were loaded using Assembly.Load or via any other means, but they are already part of AssemblyLoadContext/AppDomain
  • are in GAC

Historically, EA referenced A LOT of assemblies by default, more than 300 assemblies. This allows users to save some type on pre-configuring these dependencies on each and every C# action/BT node/etc, but this is not a good way long-term. Gradually, I'll be de-linking more and more default assemblies and will include a better auto-completion techniques which would allow to easily include those libraries which are needed for your script. In the future, this will make upgrading the program easier for everyone

csharp
#r "assemblyName: Grpc.Net.Client"

Log.Info("Hello, World!"); //you can use Grpc.Net.Client classes in that script

Bugfixes/Improvements

  • [Scripting] Fixed a problem with CancellationToken rewriter - it was handling optional arguments incorrectly in some cases