Visual Studio断点没有被击中 [英] Visual Studio breakpoints not being hit

查看:265
本文介绍了Visual Studio断点没有被击中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ASP.NET MVC项目,该项目在连接到IIS进程(w3wp.exe)时似乎遇到了一些问题。我正在我自己的本地计算机上运行解决方案和IIS 8.5,所以我不认为这与我们的网络有任何关系。对我来说很奇怪的是,我能够在本地调试的任何其他解决方案上达到断点。

I'm working with an ASP.NET MVC project that seems to be having some issues when attaching to the IIS process (w3wp.exe). I'm running the solution and IIS 8.5 on my own local machine so I wouldn't think that this has anything to do with our network. What's strange to me is that I'm able to hit the breakpoints on any other solution I debug locally.

我所遇到的问题是断点转向红色,空心圆圈,永远不会受到打击。通常,对此的修复是对解决方案的清理/重建,但这没有奏效。我已经确认通过向页面添加throw new Exception并确保它显示异常来更新代码。同样,这个问题只发生在这个问题上。我运行调试器的任何其他解决方案都可以正常工作。我也尝试重新启动应用程序池,网站,IIS以及我的计算机。

The issue I'm having exactly is that the breakpoints turn to red, hollow circles and never get hit. Usually the fix for this is a Clean/Rebuild of the solution but this hasn't worked. I've confirmed the code is being updated by adding "throw new Exception" to a page and ensuring it shows the exception. Again, this problem is only happening with this one solution. Any other solution I run the debugger with works fine. I've also tried restarting the app pool, the website, IIS, and also my computer.

我读过的一些文章提到反病毒程序可以阻止远程调试器访问进程。但是,整个设置都包含在我的本地计算机上,因此听起来不像是问题。它确实让我有点担心,因为我们最近雇用了一个新的IT人员,他们正在对每个人的机器做出很多改变。

A few of the articles I read mentioned that anti-virus programs can block a remote debugger from accessing the process. However, the entire setup is contained on my local machine so it doesn't sound like that would be the issue. It does concern me a bit though because we recently hired a new IT guy that's been making a lot of changes to everyone's machine.

另外一点,即添加该Web应用程序的独特之处在于IIS中的绑定。绑定是*,以便利用与子域相关的一些自定义功能。

One other point to add that's unique about this web application is the binding in IIS. The binding is "*" in order to leverage some custom functionality related to subdomains.

与此同时,我会继续寻找解决方案,但如果有人有任何想法可能会导致这个解决方案无法正常调试我真的很感激它。

In the meantime, I'll continue to look for a solution but if anybody has any ideas what may be causing this one solution to not debug properly I'd really appreciate it.

编辑:找到建议删除ASP.NET临时文件的解决方案。没有运气。

Found a solution that suggested deleting the ASP.NET temporary files. No luck.

推荐答案

解决了。结束为在调试菜单中选择的错误配置。我错误地将其切换到无法加载文档符号的发布配置。将它切换到调试配置,现在断点就好了。

Solved. Ended up being an incorrect configuration selected in the debug menu. I had mistakenly switched it to a release configuration that could not load the symbols for the document. Switched it to a debug configuration and the breakpoints hit just fine now.

要添加Abacus下面提到的内容,它也可能是一个搞乱你的构建的web.config转换。在我们的例子中,我们有Release配置从web.config的编译部分删除 debug 属性。下面是一个示例和Visual Studio的构建配置下拉列表的屏幕截图。

To add on to what Abacus mentioned below, it could also be a web.config transform that is messing with your build. In our case, we have Release configurations that remove the debug attribute from the web.config's compilation section. Below is a screenshot of an example and Visual Studio's dropdown list of build configurations.

注意:还要确保您的平台与配置一致。就我而言, Dev.Debug |混合平台无法正确构建解决方案,但 Dev.Debug |任何CPU 将。

NOTE: Also make sure your Platform is correct along with the configuration. In my case, Dev.Debug|Mixed Platforms does not correctly build the solution but Dev.Debug|Any CPU will.

这篇关于Visual Studio断点没有被击中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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