views:

63

answers:

2

I generate a dynamic assembly with CSharpCodeProvider, from a C# source saved into a string.

I can run the dynamic code at runtime, but if I pause the execution Visual Studio doesn't show me the dynamic source code in the call stack. It says "External code" and I can't step into that source code.

I think VS can't find PDB or other debug info. Can you help me?

A: 

I think that you should change the setting called Enable Just My Code in VS Debugging settings option. Go to Tools->Options. Choose Debugging. Uncheck the check box "Enable Just My Code(Managed Only)". Press OK.

Ikaso
Of course, you should verify that the dynamic code .pdb file is in the application folder or in the folder(s) specified by the symbol settings in visual studio.
Ikaso
+1  A: 

If you are using DynamicMethod, you can use the DynamicMethod Debugger Visualizer.

280Z28