Search Unity

ReflectionTypeLoadException: The classes in the module cannot be loaded.

Discussion in 'Editor & General Support' started by ksam2, Jan 22, 2015.

  1. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Hi guys, I can't build my project. I get below error how can I solve that?

    ReflectionTypeLoadException: The classes in the module cannot be loaded.
    System.Reflection.Assembly.GetTypes () (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/Assembly.cs:371)

    UnityEditor.Events.InterceptedEventsPreview.GetEventsInfo (UnityEngine.GameObject gameObject) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEditor.UI/UI/InterceptedEventsPreview.cs:162)
    UnityEditor.Events.InterceptedEventsPreview.Initialize (UnityEngine.Object[] targets) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEditor.UI/UI/InterceptedEventsPreview.cs:61)
    UnityEditor.InspectorWindow.GetPreviewsForType (UnityEditor.Editor editor) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:287)
     
  2. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
  3. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    No one have similar problem?
     
  4. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Have never seen this particular error scenario. what platform are you targeting?
     
  5. sanjodev

    sanjodev

    Joined:
    May 29, 2012
    Posts:
    63
    I ran into this same error when refactoring my project to break up the scripts I have to be compiled in separate DLLs. Are you using any external DLLs in your project? In my case, I had to go to the solution/projects I created for the separate DLLs, and make sure the References like to UnityEngine.dll or any other dependencies were valid and found, rebuilt the DLLs, and then copied them to my assets folder.

    Another problem was my Target framework .NET framework 3.5 or .NET framework 4.0 was inconsistent across the external DLLs, so I made sure they all used the same one.

    I would probably start deleting DLLs from your project until the errors stop so that you know the culprit DLL. Just make sure you delete the DLLs in the right order so that the dependency DLLs it relies on are all there before you call it the bad DLL.
     
  6. kristoof

    kristoof

    Joined:
    Aug 26, 2013
    Posts:
    89
    are you on windows 10? i get same error on w10TP when targeting windows store apps

    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
     
  7. sanjodev

    sanjodev

    Joined:
    May 29, 2012
    Posts:
    63
    I'm on Windows 8.1. That looks like DLL issue. The dependent DLLs are old or missing.
     
  8. kristoof

    kristoof

    Joined:
    Aug 26, 2013
    Posts:
    89
    yes, i googled it :D the dlls needs to be in plugins folder (Plugins/Metro/mydll.dll) or something like that, i sloved it with not to use dlls
     
  9. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    633
    I had the same issue, deleted uSequencer plugin and voila: Solved!
    Could be a plugin or a dll issue.