Hello
I'm trying to inject a call to a method from another assembly. The
relevant parts in my code are:

Getting the method reference:

ModuleDefinition module = ModuleDefinition.ReadModule(@"C:\some_project
\some_project\Logging.dll");
MethodReference m_logMethod =
module.Import(typeof(Logger).GetMethod("Log"));

Later I add a call instruction:
Instruction instruction_1 =
processor.Create(OpCodes.Call,m_logMethod);

Later writing back:
module.Write(...)

The emitted IL instruction is:
call       void [*]Logging.Logger::Log(string)
it doesn't work as it should be:
call       void [Logging]Logging.Logger::Log(string)

How can I emit the correct IL?

Thanks





-- 
--
mono-cecil

Reply via email to