我正在尝试使用nunit-console使用VS-宏在visual studio中调试测试,但是在将调试器/ IDE附加到nunit-console / nunit-agent时遇到了问题。我确实让宏工作了,如果我只是想运行测试,问题只出现在附加调试器的时候。
我似乎有一个僵持的问题。当我启动我的宏时,它冻结了IDE。附加之后,测试在一个断点处暂停(我想),但我看不到这一点,因为IDE是冻结的。我不能单步执行等,因为宏锁定了IDE,我不能继续测试,因为它在断点处停止。有什么想法吗?
我不能使用resharper / testdriven / extensions等,没有第三方,不要问:(,所以这是宏,类似它的东西,或者什么都不是。
使用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()发布于 2012-03-22 22:56:05
这只是一个猜测,但我怀疑Visual Studio是在它的lonesome线程上运行宏。
也许你可以试试这个:
在宏中,启动另一个线程并运行您在其中编写的代码。让宏立即退出。
https://stackoverflow.com/questions/7150648
复制相似问题