[英]How to make Visual Studio 2017 hit breakpoints when running tests through NUnit GUI 0.60?
I'm attempting to debug an NUnit 3 test from Visual Studio 2017 by using Project Properties -> Debug -> Start External Program = <path to nunit-gui.exe>
. 我试图通过使用Project Properties -> Debug -> Start External Program = <path to nunit-gui.exe>
从Visual Studio 2017调试NUnit 3测试。 I can just use the NUnit Test runner from within Visual Studio--that works fine. 我只能在Visual Studio中使用NUnit Test运行器-效果很好。 I can also run NUnit GUI first, load the DLL, and then attach to the nunit-agent-x86.exe
process and the breakpoints work. 我也可以先运行NUnit GUI,加载DLL,然后附加到nunit-agent-x86.exe
进程,然后断点开始工作。 However, I'd like to just be able to click the "Start" button from within visual Studio without going through those extra steps. 但是,我只想从Visual Studio中单击“开始”按钮,而无需执行这些额外步骤。
NUnit GUI does start and I'm able to run the test. NUnit GUI确实启动,并且我可以运行测试。 However, when I set breakpoints in Visual Studio, they don't get hit (mousing over the breakpoint yields a popover with the message, "The breakpoint will not currently be hit. No symbols have been loaded for this document."). 但是,当我在Visual Studio中设置断点时,它们不会被击中(将鼠标悬停在该断点上会弹出消息,消息为“当前不会命中该断点。尚未为此文档加载任何符号。”)。 In the past, under NUnit 2.6, I fixed this by modifying the nunit-gui.exe.config
: 过去,在NUnit 2.6下,我通过修改nunit-gui.exe.config
来解决此nunit-gui.exe.config
:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0.30319" />
<!-- <supportedRuntime version="v2.0.50727" /> -->
</startup>
However, this still doesn't seem to fix the breakpoint issue in NUnit GUI 0.60 . 但是,这似乎仍不能解决NUnit GUI 0.60中的断点问题。
My test assembly platform target is x86 (due to x86 dependencies). 我的测试组装平台目标是x86(由于存在x86依赖性)。 I'm running my test on Windows 10 64-bit. 我正在Windows 10 64位上运行测试。
In VS2017: 在VS2017中:
[Test]
and the public void
method definition. 左键单击[Test]
和public void
方法定义之间的“蓝色菱形”图标。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.