断点不会被击中 [英] The Breakpoint will not be hit

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

问题描述

这让我抓狂!每次我想调试我的代码时,断点都不会变成稳定的红色,当我将鼠标悬停在它上面时,它会显示以下消息:



- 断点不会目前被击中。源代码与原始版本不同。

- 要在源代码不同时允许断点,请右键单击断点,选择位置,然后启用允许源代码与原始版本不同'

- 要允许所有断点,请禁用ooption'要求源文件与工具>选项>调试>一般<下的原始版本完全匹配br />


无论如何,我还读到了关于清空特定Cache文件夹的问题,我过去做过这件事无济于事。我有时修改后面的代码,稍微,保存,它用于运行/调试没有问题(我附加到进程)然后,我开始得到这个恼人的消息。我该如何解决?我不明白当源代码不同时允许断点被击中是什么意思...我的意思是,当然它是不同的,我保存它,它曾经执行它。为什么现在不这样做?最重要的是,我右键单击文件并构建该特定页面(整个解决方案是一个Web站点解决方案(WSA),因此无法编译为整体)



帮助!



PS在过去,我曾经得到'没有符号已加载'或类似的东西......没有出现不再,但我得到上面列出的消息。任何帮助/洞察将不胜感激。

This is driving me crazy! Every time I want to debug my code, the breakpoint does NOT turn solid red and when I hover over it, it has the following messages:

- The Breakpoint will not currently be hit. The source code is different form the original version.
- To allow the breakpoint to be hit when the source code is different, right-click on the breakpoint, choose 'location', and turn on 'allow the souce code to be different from the original version'
- To allow this for all breakpoints, disable the ooption 'require source files to exactly match the original version' under tools>option>debugging>general

In any case, I've also read about emptying a particular Cache folder, which I've done in the past to no avail. I sometimes modify the code behind, slightly, save, and it used to run/debug without problems (I'm attaching to process) then, I started getting this annoying message. How do I fix this? I don't understand what is mean by allowing the breakpoint to be hit when the souce code is different... I mean, of course it is different, I save it, and it used to execute it. How come it's not doing it now? On top of that, I right-clicked on the files and built that particular page (the entire solution is a Web Site solution (WSA), so it cannot be compiled as a whole)

HELP!

PS In the past, I used to get 'not symbols have been loaded' or something like that... that does not appear anymore, but instead, I get the messages listed above. Any help/insight will be appreciated.

推荐答案

看起来你正在使用一个旧的DLL,它正在使用,并且不允许调试器命中你的代码。



请尝试以下方法:

1)关闭解决方案并删除build文件夹中的所有DLL。 (编辑:另外,删除所有输出文件夹和obj文件夹以删除注释中建议的PD的PDB)

2)检查程序集是否在GAC中(检查32位和64位文件夹)或不,如果它在那里,删除它。

3)重建/重新部署所有内容。

4)重新启动IIS应用程序池(以防你在IIS中管理你的代码)。

5)重启本地Web开发服务器。
It looks like you are having an old DLL somewhere which is in use and is not allowing the debugger to hit your code.

Try the following:
1) Close your solution and delete all the DLLs in the build folder. ( Also, remove all output folders and obj folder to delete the PDBs as SA suggested in the comments)
2) Check if the assembly is in GAC(check both 32 bit and 64 bit folders) or not, if it is there, remove it.
3) Rebuild/redeploy everything.
4) Restart IIS App Pool(in case you are hosing your code in IIS).
5) Restart local web development server.


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

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