NUnit 2.5.7 需要在 VS2010 下显式调试附加
我刚刚从 NUnit 2.5.2“升级”到 NUnit 2.5.7,以便我可以针对使用 .Net Framework 4 构建的 DLL 运行单元测试。我已经通过“StartExternalProgram”使用 2.5.2 很长时间了“项目属性下的属性。在这种情况下,我从未需要显式调试附加到 NUnit 进程。
现在,在 2.5.7 下,似乎必须显式附加到 NUnit_Agent 进程才能调试被测代码。
当然,这意味着我现在不必单击两次来运行单元测试,而是必须单击 VS2010 中的 Debug.Run 图标,等待 NUnit GUI 出现,按 alt-Tab 返回 VS2010,单击 Debug.Attach..,向下滚动在列表中找到 NUnit Agent,双击将其选中,按住 alt-Tab 键返回 NUnit GUI,单击“运行”来运行测试。
那么,在 2.5.7 下使用 NUnit 变得更加困难,还是有什么原因导致了失败呢?
预先感谢您提供有关从早期版本恢复“自动连接”的任何建议。
I've just "upgraded" from NUnit 2.5.2 to NUnit 2.5.7 so that I can run unit tests against an DLL's built with .Net Framework 4. I've been using 2.5.2 for a long time via the "StartExternalProgram" property under project properties. I've never had to explicitly debug attach to the NUnit process in that scenario.
Now under 2.5.7 it appears that one must explicitly attach to the NUnit_Agent process in order to debug the code under test.
Of course this means that instead of requiring two clicks to run my unit tests I now have to click Debug.Run icon in VS2010, wait for NUnit GUI to appear, alt-Tab back to VS2010, click Debug.Attach.., scroll down the list to find NUnit Agent, double click to select it, alt-Tab back to NUnit GUI, click Run to run the test(s).
So, is there a reason that using NUnit has become that much more difficult under 2.5.7 or did a ball get dropped?
Thanks in advance for any advice on restoring the "automagic attach" from earlier versions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题是 NUnit 正在启动一个子进程 (nunit-agent.exe)。我可以通过打开 nunit.exe.config 并添加以下部分来解决此问题:
编辑:如果您仍然想将 nunit 与 . Net 2.0,请确保也添加该版本。我的配置最终看起来像这样:
编辑 2:我最近还发现条目的顺序也有所不同。
The problem is that NUnit is kicking off a child process (nunit-agent.exe.) I was able to fix this by opening up nunit.exe.config and adding the following section:
Edit: If you still want to use nunit with .Net 2.0, make sure to add that version as well. My config ended up looking like this:
Edit 2: I also recently found that the order of the entries also makes a difference.
也许不能完全回答您的问题,但可以从不同的角度来看待它:Resharper 包含一个在 VS2010 gui 中运行 nunit 测试的组件,无需任何单独配置的外部程序。这可能会让你的事情变得简单?
Perhaps not quite an answer to your problem, but a different way of looking at it: Resharper includes a component that runs nunit tests within the VS2010 gui without needing any separately configured external programs. This might simplify things for you?