[IronPython] How to break in the debugger in IP when script lauched from a hosting C# process

Dino Viehland dinov at microsoft.com
Thu Dec 16 18:53:43 CET 2010


Chuck wrote:
> I have a SharePoint app (Commerce Server to be exact) that is launching an
> IronPython script.  What is the best way to be able to step into or break into
> the debugger within the IronPython script?

You should enable debug mode for the script runtime to make the code 
debuggable.  There's a DebugMode property on ScriptRuntimeSetup that 
you can set that will enable that.  Then if the code you're compiling is all
on disk w/ filenames we should emit debugging information for it (if you're
creating script sources from strings you'll need to write them out to disk
and create them from files).

>From there you should be able to attach VS and step, set break points, etc...
You don't want to do this all the time though because debuggable code
is not collectible code so you could end up leaking memory.







More information about the Ironpython-users mailing list