【问题标题】:Debug Visual Studio 2010 tests using nunit-console and VS-macro使用 nunit-console 和 VS-macro 调试 Visual Studio 2010 测试
【发布时间】:2011-08-22 16:39:39
【问题描述】:

我正在尝试使用 VS 宏使用 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()

【问题讨论】:

    标签: visual-studio-2010 debugging nunit-console visual-studio-macros


    【解决方案1】:

    这只是一个猜测,但我怀疑 Visual Studio 正在其孤独的 UI 线程上运行宏。

    也许你可以试试这个:

    在您的宏中,启动另一个线程并运行您在其中编写的代码。让宏立即退出。

    【讨论】:

      猜你喜欢
      • 2011-10-12
      • 1970-01-01
      • 2012-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-17
      • 2012-01-14
      • 1970-01-01
      相关资源
      最近更新 更多