HarmonyX icon indicating copy to clipboard operation
HarmonyX copied to clipboard

HarmonyX 2.13 in 7dtd: Interface Default Implementations failing to patch with odd error.

Open MrPurple6411 opened this issue 7 months ago • 0 comments

https://github.com/MrPurple6411/7dtd/tree/main/LargerMapRevealRadius

I have tried manual patching, and annotation patching as well as targeting net 4.8 and netstandard2.1, have switched from latest LangVer all the way back to 7.3 just incase, I have also tried specifically targeting the 2 implementation classes but they say they do not have that method and throw the not found exception instead of this error so it is ONLY in the default interface itself.

Now I am not sure if there is even anything you can do to fix this as the only mention i find of someone else asking about this was back in 2020 with no follow up. Discord_J92HUxnIPV

dnSpy_K24KnOsyg1 devenv_KKEfekKNvK output_log_client__2024-07-06__20-26-37.txt


2024-07-06T20:26:49 10.124 ERR virtual void IMapChunkDatabase::Add(Vector3i _chunkPos, World _world)
2024-07-06T20:26:49 10.139 INF [MODS][Harmony](Debug) ### Exception from user "harmony-auto-101-LargerMapRevealRadius-LargerMapRevealRadius.LargerMapRevealRadius", Harmony v2.13.0.0
### Original: virtual void IMapChunkDatabase::Add(Vector3i _chunkPos, World _world)
### Patch class: LargerMapRevealRadius.LargerMapRevealRadius
### System.ArgumentException: Owner can't be an array or an interface.
###   at System.Reflection.Emit.DynamicMethod..ctor (System.String name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[] parameterTypes, System.Type owner, System.Reflection.Module m, System.Boolean skipVisibility, System.Boolean anonHosted) [0x000bf] in <467a840a914a47078e4ae9b0b1e8779e>:0 
###   at System.Reflection.Emit.DynamicMethod..ctor (System.String name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[] parameterTypes, System.Type owner, System.Boolean skipVisibility) [0x00011] in <467a840a914a47078e4ae9b0b1e8779e>:0 
###   at System.Reflection.Emit.DynamicMethod..ctor (System.String name, System.Type returnType, System.Type[] parameterTypes, System.Type owner, System.Boolean skipVisibility) [0x00000] in <467a840a914a47078e4ae9b0b1e8779e>:0 
###   at MonoMod.Utils.DMDEmitDynamicMethodGenerator.GenerateCore (MonoMod.Utils.DynamicMethodDefinition dmd, System.Object context) [0x00315] in <a5a999fae61c47e7aeb47b4fbb925add>:0 
###   at MonoMod.Utils.DMDGenerator`1[TSelf].Generate (MonoMod.Utils.DynamicMethodDefinition dmd, System.Object context) [0x00013] in <a5a999fae61c47e7aeb47b4fbb925add>:0 
###   at MonoMod.Utils.DynamicMethodDefinition.Generate (System.Object context) [0x00149] in <a5a999fae61c47e7aeb47b4fbb925add>:0 
###   at MonoMod.Utils.DynamicMethodDefinition.Generate () [0x00000] in <a5a999fae61c47e7aeb47b4fbb925add>:0 
###   at MonoMod.RuntimeDetour.Extensions.CreateILCopy (System.Reflection.MethodBase method) [0x00007] in <1a5d3ab1634e43cd8c9776d0aef7e056>:0 
###   at MonoMod.RuntimeDetour.DetourManager+ManagedDetourState..ctor (System.Reflection.MethodBase src) [0x0003a] in <1a5d3ab1634e43cd8c9776d0aef7e056>:0 
###   at MonoMod.RuntimeDetour.DetourManager+<>c.<GetDetourState>b__10_0 (System.Reflection.MethodBase m) [0x00000] in <1a5d3ab1634e43cd8c9776d0aef7e056>:0 
###   at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00034] in <467a840a914a47078e4ae9b0b1e8779e>:0 
###   at MonoMod.RuntimeDetour.DetourManager.GetDetourState (System.Reflection.MethodBase method) [0x0000d] in <1a5d3ab1634e43cd8c9776d0aef7e056>:0 
###   at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase method, MonoMod.Cil.ILContext+Manipulator manipulator, MonoMod.Core.IDetourFactory factory, MonoMod.RuntimeDetour.DetourConfig config, System.Boolean applyByDefault) [0x0007c] in <1a5d3ab1634e43cd8c9776d0aef7e056>:0 
###   at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase source, MonoMod.Cil.ILContext+Manipulator manip, MonoMod.RuntimeDetour.DetourConfig config, System.Boolean applyByDefault) [0x00008] in <1a5d3ab1634e43cd8c9776d0aef7e056>:0 
###   at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase source, MonoMod.Cil.ILContext+Manipulator manip, System.Boolean applyByDefault) [0x00008] in <1a5d3ab1634e43cd8c9776d0aef7e056>:0 
###   at HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) [0x0000f] in <7b787fece12a47a68027108671090713>:0 
###   at HarmonyLib.PatchFunctions.UpdateWrapper (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo) [0x00033] in <7b787fece12a47a68027108671090713>:0

MrPurple6411 avatar Jul 07 '24 02:07 MrPurple6411