有没有办法用Visual Studio和PTVS调试嵌入在C#中的Python代码?

我已经创建了在C#中嵌入IronPython代码的代码

public ScriptEngine GetEngine() { if( _engine != null ) return _engine; _engine = Python.CreateEngine(); var paths = _engine.GetSearchPaths(); paths.Add( _pythonPath ); _engine.SetSearchPaths( paths ); var runtime = _engine.Runtime; runtime.LoadAssembly( typeof( CharacterCore ).Assembly ); return _engine; } public IAbility Movement() { var engine = GetEngine(); var script = engine.CreateScriptSourceFromFile( Path.Combine( _pythonPath, "movement.py" ) ); var code = script.Compile(); var scope = engine.CreateScope(); code.Execute( scope ); return scope.GetVariable( "result" ); } 

在同一解决方案中的单独Python项目中使用适当的Python代码。 代码本身有效,但是如果我在Python代码中设置断点,它就永远不会被击中。 有没有办法让调试器进入Python代码?

我正在使用Visual Studio 2015 RC(也是Visual Studio 2013),Visual Studio的Python工具(使用IronPython Launcher for Python代码)。 我试过从字符串和文件创建脚本源,调试永远不会工作。

像CreateEngine一样向CreateEngine添加选项

 var options = new Dictionary { ["Debug"] = true }; _engine = Python.CreateEngine( options ); 

并且在Debug选项中禁用“Just my code”允许调试嵌入式Python,包括断点和单步调试。

感谢Pavel Minaev和Joe对这个问题的评论,他们应该到期。