title: How to debug dynamically generated method?
body: <p>I have a dynamically created assembly, a module, a class and a dynamically generated method. </p>
  
  <pre><code>AssemblyBuilder assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(...);
  ModuleBuilder module = assembly.DefineDynamicModule(...);
  TypeBuilder tb = module.DefineType(...);
  MethodBuilder mb = tb.DefineMethod(...);
  ILGenerator gen = mb.GetILGenerator();
  </code></pre>
  
  <p>How can I debug method code generated with <code>ILGenerator</code>? I use Visual Studio 2012 debugger, but it just steps through a method call.</p>