如何select调试模式自动化Visual Studio?

How to select the debugging mode automating Visual Studio?

我有以下代码:

Process process = instance.Debugger.LocalProcesses.OfType<Process>().Single(p => p.ProcessID == processId);

process.Attach();

当我 运行 调试器使用本机代码附加时,我想指定托管代码。我该怎么做?

我还没有找到设置调试模式的方法。

有一个 Attach2 方法可以指定引擎。它记录在 msdn 上。在使用它之前,您需要转换为 Process2。

https://msdn.microsoft.com/en-us/library/envdte80.process2.attach2.aspx

您可能还想等待调试器 运行,看看 Python 工具是如何工作的:

https://searchcode.com/codesearch/view/28475480/