我正在尝试使用 VS-macro 使用 nunit-console 从 Visual Studio 调试测试,但是在将调试器/IDE 附加到 nunit-console/nunit-agent 时遇到问题。我确实有宏工作,如果我只是想运行测试,问题只是在附加调试器时。
我似乎有某种僵局问题。当我启动宏时,它会冻结 IDE。附加后,测试在断点处暂停(我认为),但我看不到这一点,因为 IDE 已冻结。我无法单步执行等,因为宏正在锁定 IDE,并且我无法继续测试,因为它在断点处停止。有任何想法吗?
我不能使用 resharper / testdriven / extensions 等,没有第 3 方,不要问 :(,所以它是宏,类似的东西,或者什么都没有。
使用 Nunit 2.5.7、VS 2010、.net 4 项目。
到目前为止我所拥有的
process.Start() 'run nunit-console
If attachDebugger then
For Each debugProcess As EnvDTE.Process In DTE.Debugger.LocalProcesses
' no parent process ID on process type, so have to look at name for the agent.
If debugProcess.ProcessID = process.Id Or debugProcess.Name.Contains("nunit-agent") Then
debugProcess.Attach()
End If
Next
End If
process.WaitForExit()
DTE.Debugger.DetachAll()