UniverseLib icon indicating copy to clipboard operation
UniverseLib copied to clipboard

Use Assembly.LoadFrom to ensure interop assemblies are loaded

Open Kasuromi opened this issue 2 years ago • 1 comments

Context

Assembly.LoadFile will load the assembly in a new AssemblyLoadContext, which causes unexpected behavior on Il2CppInterop (& Unhollower)

A similar issue was recently resolved on BepInEx

Relevant issues

sinai-dev/UnityExplorer#158

it is finding two types called Il2CppSystem.Byte in Il2Cppmscorlib

Due to UniverseLib accidentally loading a second Il2Cppmscorlib into the runtime, Il2CppInterop fails on the Single call due to there being more than one assembly.

Kasuromi avatar Sep 16 '22 18:09 Kasuromi

Hey just want to chime in and say this fixed an issue I was having with BepInEx IL2CPP plugin I was working on. Compiled the forked version @Kasuromi made and worked like a charm.

Is there any possibility of merging this fix for other users who might not find this alternate solution?

grimkor avatar Jan 08 '23 13:01 grimkor