Hey, On Wed, Apr 14, 2010 at 10:41 PM, Timwi <ti...@gmx.net> wrote: > The variables "systemEnvironmentGetStackTrace" etc. contain a > MethodDefinition that I extracted from mscorlib.dll.
You can't pass a MethodDefinition to another assembly. You have to import it first, creating a MethodReference that can be used in the module you're modifying: MethodDefinition env_get_stack_trace = ..; MethodReference env_gst_ref = module.Import (env_get_stack_trace); il.Emit (OpCodes.Call, env_gst_ref); module being the ModuleDefinition you're modifying. -- Jb Evain <j...@nurv.fr> -- -- mono-cecil To unsubscribe, reply using "remove me" as the subject.