i am attempting to modify an assembly by importing an new additional
assembly and inserting calls to a static method in that assembly at
various points.

to add the assembly, i go through all modules and add the new assembly
into each ModuleDefinition's AssemblyReference.

i am unsure of where to go from there to generate a valid
MethodReference to the desired static member.  my current attempt
opens the desires assembly with AssemblyFactory and tries to
CilWorker.Create(OpCodes.Call, _methodDefinition) from the
MethodDefinition drilled down from the AssemblyDefinition, however the
resultant code is invoking an unexpected method.  I believe I need
another approach to generating appropriate MethodReferences to
referenced assemblies, what is the way to do this?

thanks
rektide
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---

Reply via email to