HarmonyX
HarmonyX copied to clipboard
Leaking Mono.Cecil.* types from the vanilla Harmony
Hello! I'm trying to switch the Bannerlord's ecosystem to HarmonyX, but there are mods that use publicly available Mono.Cecil.*
types like Mono.Cecil.ModuleDefinition
from the 0Harmony.dll
assembly.
Could Type Forwarding be added similar to how BepinEx does that? (https://github.com/BepInEx/BepInEx.MelonLoader.Loader/tree/master/MelonLoader/BackwardsCompatibility/ForwardingAttributes)
Which version of Harmony is currently being used? Are you using BepInEx or a different modding framework? (in which case, do you have the 0Harmony20 shim?)
Harmony 2.2.2. BepinEx is not used, but we'll make our own loader soon, as we need to support both .NET Framework 472 and .NET Core 3.1 versions of the game. I already ported the type forwarding locally and I do confirm that this fixed the type leakage
There are some patching behaviour issues I noticed.
Reverse patcher's transpilers inject the wrong method with the MethodBase method
parameter. Vanilla Harmony returns the method that is being reverse-patched, HarmonyX returns the blank method that is used for the IL injection