Visual Studio“调试单元测试"未能命中断点 [英] Visual Studio "Debug Unit Test" fails to hit breakpoints

查看:24
本文介绍了Visual Studio“调试单元测试"未能命中断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用 Visual Studio 2008 并调试我的单元测试时......有时调试器工作正常.但是,在修改一些代码之后,经常单击调试单元测试"Visual Studio 将无法命中代码中的断点.调试器基本上挂了,最终测试还是用新代码运行,但从来没有停下来让我看看发生了什么.

When using Visual Studio 2008 and debugging my unit tests... sometimes the debugger works fine. However very often after modifying some code then clicking "Debug Unit Test" Visual Studio will fail to hit the breakpoints in the code. The debugger basically hangs and eventually the tests runs with the new code anyway, but never stops to let me see what is going on.

我假设这与调试器完成的某种类型的程序集缓存有关,但无论我做什么(清理项目、删除 bin 文件夹、重新启动 VS 等)我都无法获得正确的程序集加载.有没有其他人看到过这种行为?有什么解决办法吗?

I'm assuming this has something to do with some type of assembly caching done by the debugger, but not matter what I do (clean project, delete bin folders, restart VS, etc) I can never get the right assembly to load. Has anyone else seen this behavior? Any solutions?

顺便说一下,在 Win XP 上使用 Resharper 4.5 和 .NET 3.5.

By the way, using Resharper 4.5, and .NET 3.5 on Win XP.

推荐答案

我刚刚在 VS2015 中遇到断点问题.

I just had a problem hitting breakpoints in VS2015.

我总是使用名为 Debug 的解决方案配置,但出于某种原因,我的解决方案被设置为构建发布版本.

I am always using the solution configuration called Debug but for some reason my solution was set to build the Release version.

在 Visual Studio 顶部的下拉列表中从发布切换到调试解决了我的问题.

Switching from Release to Debug in the dropdown at the top of Visual Studio fixed my problem.

这篇关于Visual Studio“调试单元测试"未能命中断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆