pardeike / Harmony

A library for patching, replacing and decorating .NET and Mono methods during runtime
https://www.patreon.com/pardeike
MIT License
5.29k stars 493 forks source link

CLR detected an invalid program #107

Closed NimbusFox closed 6 years ago

NimbusFox commented 6 years ago

Instance.Patch(eventItem.Original, eventItem.HPrefix, eventItem.HPostfix);

I am trying to get this to work with my system but when I call this everything is fine until the function needs to be called.

It keeps throwing up this error https://i.imgur.com/DG0QVhK.png for some reason it is trying to create a function with a nameless object. Any ideas to why this is happening?

NimbusFox commented 6 years ago

Nevermind. The function inserted was not static