I have some code that uses System.Reflection.Emit to generate
DynamicMethod's.

I can get the IL as a byte[] via the following -

Action myMethod = ... ;

byte[] myMethodIL = myMethod.Method.GetMethodBody().GetILAsByteArray();

The code that generates the dynamic method increases the startup time of our
application and we'd like to reduce that by generating the code at compile
time then injecting the compiled method into the assembly post-build.

Is there some way I can take this byte[] and get an InstructionCollection
from it? That way I can create a new MethodDefinition and add it to the
module.

Thanks
 - Brandon


-- 
View this message in context: 
http://old.nabble.com/Can-I-use-Cecil-to-write-IL-from-a-byte----tp27132028p27132028.html
Sent from the Mono - Cecil mailing list archive at Nabble.com.

-- 
--
mono-cecil

Reply via email to