Hello,
I have had a difficult time when using DLLs in Unity. I create these libraries myself in C# in Visual Studios, and they are hardly complicated at all. They are simple things such as reusable interfaces, or network connections. For this example I am using a simple interface which is just a compilation of classes with global variables and references to one another to form dynamic skill trees. When I first added this library to Unity and compiled a couple of scripts and tested the libraries out by displaying info on a GUI to make sure it’s working, everything was fine and worked. Fast forward a few hours, it seems at random, I will add a new script in Unity, and try to compile, I get no errors from the script editor, but Unity console has these errors and won’t run:
All compiler errors have to be fixed before you can enter playmode!
UnityEditor.SceneView:ShowCompileErrorNotification()
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 :0
at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in :0
at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in :0
at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in :0
at Mono.CSharp.Driver.LoadReferences () [0x00000] in :0
at Mono.CSharp.Driver.Compile () [0x00000] in :0
at Mono.CSharp.Driver.Main (System.String[ ] args) [0x00000] in :0
Nothing of importance has changed. It just seems like Unity all the sudden is unable to use the libraries, and will never fix itself unless I remove the libraries and just manually create the scripts within the project itself…This negates the purpose of building libraries. I tried Googling this issue, but without luck. Does anyone have any insight?
Regards,