I am trying to generate some code at runtime using the DynamicMethod class in the Reflection.Emit namespace but for some reason its throwing a ‘VerificationException’. Here is the IL code I am trying to use…
ldarg.1 ldarg.0 ldfld, System.String FirstName callvirt, Void Write(System.String) ldarg.1 ldarg.0 ldfld, System.String LastName callvirt, Void Write(System.String) ldarg.1 ldarg.0 ldfld, Int32 Age callvirt, Void Write(Int32) ret
I need a way to debug the generated IL code. What options do I have? I am using VS2008 professional.
I have found some more help here…
DebuggerVisualizer for DynamicMethod (Show me the IL) It’s is a debugger visualizer using which you will be able to see the generated IL at runtime!
And even better is Debugging LCG which allows you to debug the generated code at runtime using Windbg!