vendredi 1 septembre 2017

Mono.CSharp.Evaluator.ReferenceAssembly() throwing NullReferenceException

Using Mono.CSharp.dll version 2.0 targeting .Net 3.5.
Using the Unity Editor version 5.6.3p1.
There is a using statement for .

Here is my code:

Evaluator.Init(new string[] { });
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
    Evaluator.ReferenceAssembly(assembly);

(not shown: using Mono.CSharp;)

Here is the error (throwing on that third line):

NullReferenceException: Object reference not set to an instance of an object
Mono.CSharp.TypeManager.IsThisOrFriendAssembly (System.Reflection.Assembly assembly)
Mono.CSharp.Namespace.RegisterExternalExtensionMethodClass (System.Type type)
Mono.CSharp.RootNamespace.RegisterExtensionMethodClass (System.Type t)
Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType)
Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType)
Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx)
Mono.CSharp.Driver.LoadReferences ()
Mono.CSharp.Evaluator.InitAndGetStartupFiles (System.String[] args)
Mono.CSharp.Evaluator.Init (System.String[] args)
CharlesOlinerCommandConsole.CommandConsole.Start () (at Assets/CommandConsole/Scripts/CommandConsole.cs:123)

I tried elevating the permissions of the Unity Editor, but it did not work.
I also tried putting Mono.CSharp.dll in the plugins folder, but that also did not work.

Any help is appreciated.





Aucun commentaire:

Enregistrer un commentaire