I have built a simple Windows Store plugin with a single method. It worked, and the functionality worked correctly in my game (I could build and deploy with no issues). However, when I came back to work on the game I was getting errors that seem to be caused by my plugin.
Now I can’t even play the game inside Unity without removing the ‘fake’ DLL, and I can’t build for Windows Store without having the fake DLL there…
Here is the error message:
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
If I delete the fake DLL the error disappears (and I can run the game in the editor).
- My DLLs are correctly named and share the same namespaces, etc
- Both game and plugin target Windows 8.1
- Fake DLL is in the plugins folder, real one is in the Plugins/Metro folder
- Plugin projects target .net 3.5
- I’ve used #if NETFX_CORE to wrap code in my plugin and #if UNITY_METRO within Unity scripts
- FWIW I have a WP8 plugin that is similar and works fine
Here is a repro of my DLL files (I’ve included the full VS solution in case someone is kind enough to check for dumb errors. The built DLLs are in the respective bin/release folders of the two projects. The entire source code is there (it’s just a single method that launches an email).
Any ideas what I’ve done wrong? The weird thing is that it worked fine, then suddenly gives this showstopper error.