C# Visual Studio 2012 不允许我调试
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15725086/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio 2012 won't let me debug
提问by will
I can't seem to be able to debug. When I try to, I don't get any build errors, and the layout changes to debug mode, but the windows never pops up. I have an orange bar at the bottom of VS, which I think is standard, but nothing happens after that. It's not just in the project I'm working on. I have started a new WFA and tried to debug without adding any code and the same thing happens. Anybody have similar issues?
我似乎无法调试。当我尝试时,我没有收到任何构建错误,并且布局更改为调试模式,但窗口永远不会弹出。我在 VS 底部有一个橙色条,我认为这是标准的,但之后没有任何反应。这不仅仅是在我正在从事的项目中。我已经启动了一个新的 WFA 并尝试在不添加任何代码的情况下进行调试,并且发生了同样的事情。有人有类似的问题吗?
回答by John S.
I've encountered this before. Not sure what causes it, but generally it is one of a couple of things to fix it.
我以前遇到过这种情况。不确定是什么原因导致它,但通常它是修复它的几件事之一。
- make sure you are building in debug and not release
- close VS, go to the project's dir and delete the obj and bin directories. Reopen in VS and rebuild.
- there is an option under tools - options - build (iirc) that allows for checking if source is same as code file. However, you should see a message in output window if this is the case.
- on the project properties in the build (iirc) you can throttle the pdb file from full debug symbols to no pdb at all. If you are not the only person on the project check this setting still has full pdb enabled (low probability this got changed though)
- make sure you're on the right platform that you are building to (x64 vs x32)
- 确保您在调试中构建而不是发布
- 关闭VS,进入项目目录,删除obj和bin目录。在 VS 中重新打开并重建。
- 工具 - 选项 - 构建(iirc)下有一个选项,可以检查源代码是否与代码文件相同。但是,如果是这种情况,您应该会在输出窗口中看到一条消息。
- 在构建 (iirc) 中的项目属性上,您可以将 pdb 文件从完整的调试符号限制为根本没有 pdb。如果您不是项目中唯一的人,请检查此设置是否仍然启用了完整的 pdb(尽管更改的可能性很小)
- 确保您在构建的正确平台上(x64 vs x32)
...lots more, but a starting place...
......更多,但一个起点......
Addendum as per comment...
根据评论补充...
So, those messages are good. It is saying there are no problems (but it sounds like you already know that :) ). I would start with the general debug options you mention. Do this on a hello world app. That way you can troubleshoot the lowest common first. Here are my settings. Try to match them and see if that works. For example, I know "ask before deleting breakpoint" is irrelevant, but "break all processes when one process breaks" is important. So, I just added them all to make it easier to troubleshoot.
所以,这些消息是好的。它说没有问题(但听起来你已经知道了:))。我将从您提到的一般调试选项开始。在 hello world 应用程序上执行此操作。这样您就可以首先排除最低公共故障。这是我的设置。尝试匹配它们,看看是否有效。例如,我知道“删除断点前询问”是无关紧要的,但是“当一个进程中断时中断所有进程”很重要。因此,我只是将它们全部添加进来,以便更轻松地进行故障排除。
ALso, make sure you are getting a red dot here like so in your code in visual studio (I've seen instances where VS won't let you put this here):
另外,请确保您在 Visual Studio 中的代码中像这样在此处得到一个红点(我已经看到 VS 不允许您将其放在这里的实例):
回答by Alex
This is an issue with visual studio 2012. It doesn't ALWAYS show up. I've found that if you stop your program during debugging, or if you close the console window, this will almost always trigger.
这是 Visual Studio 2012 的问题。它并不总是出现。我发现如果在调试期间停止程序,或者关闭控制台窗口,这几乎总是会触发。
However, letting it run to completion isn't enough either, sometimes this just happens.
然而,让它运行完成也是不够的,有时这只是发生。
Also you can build your application in debug mode, go to the output, run the program, and attach to that process. :P
您也可以在调试模式下构建应用程序,转到输出,运行程序,然后附加到该进程。:P
回答by vijay
try checking your output without debugging Ctrl + F5
尝试在不调试的情况下检查输出 Ctrl + F5
good luck
祝你好运
回答by KMX
Amazing answers already given but they dont help in the purpose. So here is my finding, no matter if i am late in answering, but it really works for me.
已经给出了惊人的答案,但它们对目的没有帮助。所以这是我的发现,无论我回答是否迟到,但它确实对我有用。
Even if you are developing a web app, just go to the website properties by right-clicking the project and then you see a "Web" tab on left as i have highlighted. Then just check the box saying "Enable Edit and Continue". Thats all you need to do. it works for me!
即使您正在开发 Web 应用程序,只需通过右键单击该项目转到网站属性,然后您会在左侧看到一个“Web”选项卡,正如我所强调的那样。然后只需选中“启用编辑并继续”框。这就是你需要做的。这个对我有用!
回答by Igor Trkulja
I had a similar problem, and solution was absolutely dumb. VS was confused with two instances of Internet Explorer in “Browse with” setting. So, I set Google Chrome (any browser) as default, and then set IE as default again. It deleted the other instance of IE (only one remained) and debugging was enabled. Hope it help!
我有一个类似的问题,解决方案绝对是愚蠢的。VS 在“浏览方式”设置中与两个 Internet Explorer 实例混淆。因此,我将 Google Chrome(任何浏览器)设置为默认值,然后再次将 IE 设置为默认值。它删除了 IE 的另一个实例(只剩下一个)并启用了调试。希望有帮助!
回答by user3082600
- Right click on the project
- Click on the properties.
- go to web.
- Check the Box for Enable Edit and Continue .
- 右键单击项目
- 单击属性。
- 上网。
- 选中 Enable Edit and Continue 复选框。
Hope that helps :)
希望有帮助:)
回答by user2286810
I had a similar issue.
我有一个类似的问题。
I added up:
我加起来:
using namespace std;
使用命名空间标准;
and this solved the problem
这解决了问题
回答by Mukus
For me, uninstalling the Redgate's Reflector plugin that had expired fixed it. I spent more than 4 hours uninstalling, rebooting, reverting to older code, etc etc..
对我来说,卸载已经过期的 Redgate 的 Reflector 插件修复了它。我花了 4 个多小时卸载、重新启动、恢复到旧代码等。
回答by Hunter Kingsley
When my default browser was changed to CHROME, I could no longer debug my User Interface. Setting IE back to the default browser fixed it. Alternatively you can attach the process plug-in during debug.
当我的默认浏览器更改为 CHROME 时,我无法再调试用户界面。将 IE 设置回默认浏览器修复了它。或者,您可以在调试期间附加流程插件。
回答by g_brahimaj
I had the same problem with my desktop application and as this forum says you should mark your project as a startup project, since visual studio has unmarked. It worked just fine for me an I believe it will help other people that may have this problem, since I believe you have finished this project.
我的桌面应用程序也有同样的问题,正如该论坛所说,您应该将您的项目标记为启动项目,因为 Visual Studio 已取消标记。它对我来说很好用,我相信它会帮助其他可能有这个问题的人,因为我相信你已经完成了这个项目。