- Home /
Plugins don't play nicely
I have a plugin that works great well on its own, but when I add my networking layer's plugin to it, KABOOM! I get the following error:
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
Any ideas how to go about debugging this? I've notified the makers of the network plugin as well. I'm just blocked again and blocked is not my best emotional state so I'm asking everywhere.
Answer by aubreuil56 · Mar 23, 2014 at 07:12 PM
I'm getting a very similar error when I reference a dll I created that itself references NHibernate,the System.Reflection assembly is for resolving all these refs at runtime. Somehow the Unity compiler is not following normal CIL rules, something to do with Mono, even if you tell Visual Studio what to do with all your referenced dlls, the Unity compiler has it's own way of doing things. It doesn't even run in an AppDomain.
Sorry is not an answer but when I get to the bottom of it will post... EDIT: This network layer plugin, use Object Browser to see what other dlls it depends on, make sure to import these as well into unity (as it won't do it for you) also make sure your advanced player settings are set to .NET 2.0, not the .NET 2.0 Subset. and that the network plugin was built for .NET 3v5
Answer by judy3turn · Mar 23, 2014 at 09:21 PM
Fortunately, the MuchDifferent team was able to solve the problem. I had to turn of /clr. This requires removing a lot of code Visual Studio added as part of setting up the project, but once all of that code was removed, it worked nicely with all the other plugins.
You have to turn it off twice, once under general and once under C++.
I hope this helps someone else as well.
Your answer
Follow this Question
Related Questions
Is Pro really required for plugins on iOS? 1 Answer
64bit Plugin DllNotFoundExeception in Editor Only 0 Answers
C++ in unity 1 Answer
Using Native Plugins in an Android Project and Executing in the Unity Editor 0 Answers
Visual C# Plugin 1 Answer