The ScriptRuntimeSetup class has a DebugMode flag that can be set.  When you do 
ScriptRuntime.Create you can pass it the ScriptRuntimeSetup object that you 
created.

FYI configuration is going through some reviews and changes so this will soon 
be slightly different but you'll do the same basic stuff - create some setup 
object and then pass it off to the ScriptRuntime.

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joshua Peterson
Sent: Monday, July 21, 2008 6:58 AM
To: [email protected]
Subject: [IronPython] IronPython.Hosting.EngineOptions.ClrDebuggingEnabled in 
IronPython 2.0 Beta 3

I'm working with a C# application that hosts IronPython 2.0 Beta 3.  I would 
like to be able to use the IronPython integration sample that ships with the 
Visual Studio 2005 SDK to debug the python code running in my C# application.

If I host IronPython 1.1 in a C# application, I can set the 
IronPython.Hosting.EngineOptions.ClrDebuggingEnabled flag to true as in the 
example below.  This allows me to step through the python code in test.py in 
Visual Studio.  Is there something similar to the ClrDebuggingEnabled in 
IronPython 2.0?  Thanks.

Josh

Program.cs:

using System;
using System.Collections.Generic;
using System.Text;
using IronPython;
using IronPython.Hosting;

namespace TestDebugEmbeddedIronPyton
{
    class Program
    {
        static void Main(string[] args)
        {
            EngineOptions eo = new EngineOptions();
            eo.ClrDebuggingEnabled = true;
            PythonEngine pe = new PythonEngine(eo);
            pe.ExecuteFile(@"C:\test.py");
        }
    }
}

test.py:

import System
import System.Diagnostics
print "Test 1"
System.Diagnostics.Debugger.Break()
print "Test 2"

--
Rejoice always. Pray without ceasing. In all circumstances give thanks, for 
this is the will of God for you in Christ Jesus. -- 1 Thes. 5:16-18 NAB
--
I am the living bread that came down from heaven; whoever eats this bread will 
live forever; and the bread that I will give is my flesh for the life of the 
world. -- John 6:51 NAB
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to