Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ReflectionTypeLoadException: The classes in the module cannot be loaded.

Discussion in '2017.2 Beta' started by makeshiftwings, Sep 27, 2017.

  1. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I just updated my project from 2017.1 to 2017.2.1f. It throws this error any time I click on anything in the editor. As you can see, it doesn't point to any code within the project, so I have no idea what's causing it. Any ideas on what to track down? I put try/catches around every call to Assembly.GetTypes() in existing code as suggested in the upgrade guide but that didn't fix it, since this call to GetTypes() is coming from Unity code.

    ReflectionTypeLoadException: The classes in the module cannot be loaded.
    System.Reflection.Assembly.GetTypes () (at <9c9f068c46c64ffd91fda7af157b4d15>:0)
    UnityEditor.GridPaletteBrushes.RefreshBrushesCache () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaletteBrushes.cs:97)
    UnityEditor.GridPaletteBrushes.get_brushes () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaletteBrushes.cs:24)
    UnityEditor.GridPaintingState.get_gridBrush () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintingState.cs:80)
    UnityEditor.GridPaintingState.get_activeBrushEditor () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintingState.cs:112)
    UnityEditor.GridPaintingState.get_validTargets () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintingState.cs:167)
    UnityEditor.GridPaintingState.OnSelectionChange () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintingState.cs:37)
    UnityEditor.Selection.Internal_CallSelectionChanged () (at C:/buildslave/unity/build/artifacts/generated/common/editor/SelectionBindings.gen.cs:205)
     
  2. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Also, just wanted to add I'm not actually using any Tilemaps in the project anywhere, unless some asset from the asset store has one that I missed. I tried opening the Tilemap window and it throws hundreds of errors and the buttons don't work. I've never used tilemaps before, though, so maybe that's normal. ;)
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    Hi makeshiftwings,
    Thanks for reporting this issue! A fix is already in the works.
     
    makeshiftwings likes this.
  4. Chris-V

    Chris-V

    Joined:
    Jul 29, 2015
    Posts:
    8
    I'm experiencing the same issue after importing the Behavior Designer asset. Reverting to older versions of Unity doesn't fix the issue. The asset is unusable because of the error. Is the fix expected to be deployed in the next beta release?
     
  5. Chris-V

    Chris-V

    Joined:
    Jul 29, 2015
    Posts:
    8
    Actually on further inspection it seems my issue is more specific. It is the result of the combination of 3 things:
    1. Using the experimental .NET 4.6 Mono runtime.
    2. Importing the Behavior Designer asset (https://www.assetstore.unity3d.com/en/#!/content/15277)
    3. Importing Google's GRPC.Core .NET library (https://www.nuget.org/packages/Grpc.Core/)
    This combination appears to trigger some conflicting library reference perhaps? Will the fix mentioned above cover this case or is this a separate issue?
     
  6. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    Hi Chris,
    That is a related issue and will be resolved by the fix. We're trying to get it in for the final release, but it might get delayed until the first patch.
     
    Last edited: Oct 2, 2017