How to debug InvalidProgramException when issuing code for DynamicMethod

After searching for stackoverflow plus googling alot, the code debugging solutions that emit for DynamicMethods look outdated and very cumbersome.

Of course, within 4 or more years since the release of LCG (easy code generation), someone had to find a better way.

What you find is the easiest way to test the dynamic IL that you write and debug?

Are you using peverify or ILDasm or something else? These 2 tools require writing the assembly to disk, but DynamicMethod does not offer a direct way to do this.

Obviously, WinDbg aso offers a way to see IL, but it is very inconvenient for this.

Something like a plugin for VisualStudio 2010 would be perfect.

Any ideas?

+5
source share
1 answer

You can use ILGenerator.MarkSequencePoint to allow you to debug your emitted code step by step.

0
source

All Articles