MS测试->为什么我不能使用断点进行调试?
我设置断点,然后在 Visual Studio 中运行“运行测试”。为什么 MSTest 不运行到我的断点?
I setup breakpoints, then run "Run Tests" in Visual Studio. Why don't MSTest run to my breakpoints?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
选择
调试
->当前上下文中的测试
(或其他)Choose
Debug
->Tests In Current Context
(or otherwise)对于 Visual Studio 2012 Express,我选择:
TEST
->调试
->所有测试
For Visual Studio 2012 Express, I chose:
TEST
->Debug
->All Tests
当通过
启动外部程序
使用MSTest时,“mstest”指定/noisolation
选项。When using MSTest via
Start external program
"mstest" specify the/noisolation
option.升级到 MSTest V2。我引用了新的 nuget 包,删除了现有的 MSTest 引用,但没有调试。我阅读 我不应该再使用测试设置文件,所以我删除了它;没有喜悦。我终于发现清除我的临时目录可以解决问题。
I had this problem after upgrading to MSTest V2. I referenced the new nuget packages, removed the existing MSTest reference, but no debugging. I read that I should no longer be using a test settings file, so I removed that; no joy. I finally discovered that clearing out my temp dir did the trick.
就我而言,我选择了发布版本。当我切换到调试时,我的断点被命中。
In my case it was that I had selected Release build. When I switched to Debug then my breakpoint was hit.
视觉工作室 2022
使用 msTest,选项:
问题在于您“运行”测试,但您必须“调试”测试,以便可以利用断点。
干杯。
有关 的参考在 Visual Studio 中测试
Visual Studio 2022
with msTest, options:
the problem is that you "run" the test, but you must "debug" the test so you can make use of break points.
cheers.
Reference about Testing in visual studio