Scripting engine fully supports referencing external assemblies, be it loading from file or from NuGet.
Important! Referencing assemblies is available only inside Script.csx
which is equivalent of your Program.cs
in "normal" C#.
Allows you to reference any NuGet packages which are out there in the wild. EA will download the package and will try to reference/load all parts of it just like compilers do it in normal programming workflows.
#r "nuget: Coroutine, 2.1.5"
Log.Info("Hello, World!"); //you can use Coroutine classes in that script
This way of referencing assemblies allows you to read the data from local files. This could be useful if the assembly is not available on NuGet for some reason.
#r "assemblyPath: D:\Work\EAExile\EAExileAgent.Shared.dll"
Log.Info("Hello, World!"); //you can use EAExileAgent classes in that script
This method of referencing assemblies allows you to reference those assemblies which are either:
Assembly.Load
or via any other means, but they are already part of AssemblyLoadContext/AppDomainHistorically, 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
#r "assemblyName: Grpc.Net.Client"
Log.Info("Hello, World!"); //you can use Grpc.Net.Client classes in that script