paevensonKratos
Topic Author
Posts: 9
Joined: 11 Mar 2014, 20:24

ReflectionTypeLoadException

11 Mar 2014, 20:36

I have no idea what happened but I now have this error I cannot fix.
ReflectionTypeLoadException: The classes in the module cannot be loaded.
System.Reflection.Assembly.GetTypes () (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/Assembly.cs:371)
Noesis.Extend.RegisterExtendClasses () (at Assets/Plugins/NoesisGUI/Scripts/Core/NoesisExtend.cs:122)
Noesis._Extend.RegisterExtendClasses () (at Assets/Plugins/NoesisGUI/Scripts/Core/NoesisExtendImports.cs:37)
Noesis.BuildToolKernel..ctor (System.String platform) (at Assets/Editor/NoesisGUI/NoesisBuildToolKernel.cs:61)
Any idea on what is going on? I get this error when I try to Build from the NoesisGUI settings and when I run the scene. In the previous version I was crashing constantly(I updated to 1.1.5 today). Everything works fine importing to a new Unity Project, but I need to fix this in my current project.

Thanks,

Paul
 
User avatar
sfernandez
Site Admin
Posts: 1911
Joined: 22 Dec 2011, 19:20

Re: ReflectionTypeLoadException

11 Mar 2014, 22:27

Hi Paul,

The exception in Assembly.GetTypes() occurs when any type in the assembly depends on a type in an assembly that has not been loaded. This means that your project contains some assemblies that depend on other assemblies not loaded when NoesisGUI initializes.

There is no problem to catch and discard the exception, while these unloaded types are not related to Noesis (they are not extended classes used in xaml files).

Another customer reported us this same problem and it will be solved for the next release.

PS: I'll send you a PM.
 
paevensonKratos
Topic Author
Posts: 9
Joined: 11 Mar 2014, 20:24

Re: ReflectionTypeLoadException

12 Mar 2014, 13:43

Thanks sfernandez for getting back to me so quickly! The fix you sent me was a great help. One addition you may want to add to each function is a check to make sure types != null before each for loop. Otherwise you will get a NullReferenceException when the loop tries to access the types array. :D

Thanks again for your timely response!

-Paul
 
User avatar
sfernandez
Site Admin
Posts: 1911
Joined: 22 Dec 2011, 19:20

Re: ReflectionTypeLoadException

14 Mar 2014, 16:52

You are welcome.

I will add that check as you suggested, thanks for your collaboration.

Regards,
- Sergio

Who is online

Users browsing this forum: No registered users and 0 guests