Skip to content

trouble debugging failed assembly loads #127

Description

@UltraBlackLinux

Hey there,
I'm currently trying to get Unity to compile a plugin for a windows game natively on linux. I'm running into one major roadblock though - how do I debug this error?

[Warning:  HarmonyX] AccessTools.GetTypesFromAssembly: assembly AtlasSampleScene, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null => 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 HarmonyLib.AccessTools.GetTypesFromAssembly (System.Reflection.Assembly assembly) [0x00000] in <filename unknown>:0

The error seems very vague.
I asked chatgpt for a quick and dirty patch to enhance logging here and it spat out this:

foreach (var loaderEx in ex.LoaderExceptions)
    {
        Debug.LogError("Loader exception: " + loaderEx.Message);
    }

I would be trying to add this to the code and recompile the project but I have frankly no idea how to do that. There aren't and build instructions so I don't really know what I need. Just purely going off of the dotnet version in the readme, I can't even seem to be able to get these old versions in my distro's repos.

Any idea how else I could tackle this?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions