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

查看:283
本文介绍了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天全站免登陆