UnityREPL icon indicating copy to clipboard operation
UnityREPL copied to clipboard

Evaluator fails to load assemblies with .Net 4.x Equivalent Scripting Runtime

Open spacehamster opened this issue 7 years ago • 1 comments

After setting the Scripting Runtime Version to .Net 4.x Equivalent , I get the following error

NullReferenceException: Object reference not set to an instance of an object
Mono.CSharp.PredefinedAttribute.Resolve (System.Boolean canFail) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.TypeManager.IsThisOrFriendAssembly (System.Reflection.Assembly assembly) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.Namespace.RegisterExternalExtensionMethodClass (System.Type type) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.RootNamespace.RegisterExtensionMethodClass (System.Type t) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.Evaluator.ReferenceAssembly (System.Reflection.Assembly a) (at <c8c039196d284944be96b9057c4d6976>:0)
EvaluationHelper.TryLoadingAssemblies (System.Boolean isInitialized) (at Assets/Editor/UnityREPL/Evaluator.cs:35)
EvaluationHelper..ctor () (at Assets/Editor/UnityREPL/Evaluator.cs:21)
Shell..ctor () (at Assets/Editor/UnityREPL/Shell.cs:47)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)

This exception happens for all the assemblies from AppDomain.CurrentDomain.

spacehamster avatar Sep 10 '18 00:09 spacehamster

Lovely. Chances are something major changed in how assembly loading is managed along the way. I'll try to take a look at this this weekend, but can't make any promises. If you happen to get things into working shape, I'd welcome a PR -- even if it's not super clean.

MrJoy avatar Sep 18 '18 23:09 MrJoy