- Home /
Error building Player because scripts had compiler errors
Hello,
I use Unity 5.0.2 and i have a probleme when i want build my game (standalone) :
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
I have made :
Api = .Net 2.0
How i can fix this probleme ?
Thank you
I have already deleted the library forlder. (last weeks for another probleme).
Where i can find the temp & bin folders ?
It looks like you're using an imported DLL. Is that the case?
Why do you need .NET 2.0 as Api compatibility level ?
I don't know, this .Net 2.0 or .Net 2.0 Subset, Net 2.0 is by default (for me)
What do you mean by imported DLL ?
This is DLL of plugin or asset ?
Answer by NinjaISV · Jul 09, 2015 at 04:17 PM
I believe the you're using a dll that is incompatible with .Net 2.0. I also did this once when I was trying to use System.Windows.Forums
, but I was accidentally using a dll that was for .Net 4.0. You'll have to either remove that dll or get one that is compatible with your .Net version. (Unity only supports 2.0 at this time.)
Thanks for you'r help, how i can know if the dll use .Net 4.0 or 4.5 ?
Right click on the dll and open the properties menu. (Not in Unity.) Go to the details tab and look at the "product Version" label. The first two digits should be 2 and 0 (The rest of the digits don't matter. At least as far as I know.) anything higher is not compatible with .Net 2.0.
Also, I'm not sure, but I may have found one compatible with .Net 2.0. Let me know if it works. Paste this in a folder explorers' address bar: "C:\Windows\$$anonymous$$icrosoft.NET\Framework\v2.0.50727" Then copy the file: "mscorlib.dll" into your "Plugins" folder in Unity.
I have check all the DLL of my project and i have found one DLL with version product "6.3".
This is "D3DCompiler-47_x86" (and x64)
I have make what you ask me (with mscorlib.dll) and that doesn't work :(
I have test to move the D3DCompiler.dll (x86 & x64) out of the project but i can't always build.
Okay, that dll is the problem. You'll have to find a way to work around the one that is 6.3. Also, sorry about that dll I gave you, I wasn't sure if it would work or not, I just thought it was worth a shot.
Yes but if i delete or move this dll the probleme is still here :(
Answer by MarxentAnthony · Jul 07, 2015 at 10:16 PM
Are you building to Mac or IOS? Because there is not support for Reflections on those platforms