Hey, On Wed, Jul 7, 2010 at 4:46 PM, TheCoop <[email protected]> wrote: > I'm trying to call a method in mscorlib, but I'm slightly stuck in > that I can't figure out how to get a ModuleDefinition to mscorlib so > the calls can be scoped correctly
I already answered the question you asked on SO: http://stackoverflow.com/questions/3195745/mono-cecil-how-can-i-get-a-moduledefinition-for-mscorlib If you retrieve a method from the mscorlib, don't forget to import it before using it in the module you're modifying. > and there doesn't seem to be any > documentation on how to actually do this... There's http://wiki.github.com/jbevain/cecil/importing which is an importing reading if you want to do IL injection. You can also read the tests which are pretty informative: http://github.com/jbevain/cecil/blob/master/Test/Mono.Cecil.Tests/ImportCecilTests.cs http://github.com/jbevain/cecil/blob/master/Test/Mono.Cecil.Tests/ImportReflectionTests.cs -- Jb Evain <[email protected]> -- -- mono-cecil
