I spent some hours trying solutions I found online but nothing worked so here's my question for Stackoverflowers.
I made a small plugin for Unity and imported the dll into my project folder. It works fine when I launch the game within the editor but if I try to compile I get the following:
Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0
at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0
at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0
at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0
What I did so far:
- my dll is in the Plugins folder in Assets
- tried to place the dll (also) in the project root
- tried with and without namespaces
- set .NET 2.0 in Unity
And by the way, it works fine in Unity Editor so it should be pretty clear that I made it right as I followed the instructions in the official Plugins making guide.
Thanks for any help