HarmonyX
HarmonyX copied to clipboard
The test code works in C# console app,but not in Unity
first I put the dlls in Unity's plugin folder:
And then I copy paste the code in C# console app
And I got this error:
System.TypeInitializationException: An exception was thrown by the type initializer for HarmonyLib.AccessTools ---> System.TypeInitializationException: An exception was thrown by the type initializer for MonoMod.Utils.DynamicMethodDefinition ---> System.TypeInitializationException: An exception was thrown by the type initializer for MonoMod.Utils.ReflectionHelper ---> System.NullReferenceException: Object reference not set to an instance of an object
at MonoMod.Utils.ReflectionHelper..cctor () [0x00000] in
It is caused by inconsistent target frameworks. It seems like you are using a target framework that is not supported by Unity. When developing plugins, it is advisable to use .NET 3.5 as the target framework.