visual-studio Visual Studio 不调试

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1582788/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 11:06:23  来源:igfitidea点击:

Visual Studio not debugging

visual-studiodebugging

提问by Paul Knopf

When I press F5, my web application starts up and runs, but the Visual Studio debugger is not attached to the process. The play button is always enabled.

当我按下 时F5,我的 Web 应用程序启动并运行,但 Visual Studio 调试器未附加到该进程。播放按钮始终处于启用状态。

I checked the configuration manager and all the libraries and web applications are debug|any-cpu.

我检查了配置管理器,所有的库和 Web 应用程序都是debug|any-cpu.

采纳答案by Buggieboy

You can also run your web application outside of Visual Studio, then select Debug->"Attach to process". In the process list, choose the ASP.NET working process, "asp_wp.exe".

您还可以在 Visual Studio 之外运行您的 Web 应用程序,然后选择 Debug->"Attach to process"。在进程列表中,选择 ASP.NET 工作进程“asp_wp.exe”。

回答by Doron Yaacoby

Have you set

你设置了吗

<compilation debug="true"/>

In your web.config file?

在你的 web.config 文件中?

回答by GlennG

Oh how I hate this answer, but it has just worked for me...

哦,我多么讨厌这个答案,但它对我有用...

Symptoms: it works fine for weeks, then simply refuses to debug.

症状:它可以正常工作数周,然后只是拒绝调试。

Solution: close Visual Studio, delete the contents of the Bin directory, reboot.

解决方法:关闭Visual Studio,删除Bin目录下的内容,重启。

Irritatingly it required a full reboot to get it to start debugging; restarting Visual Studio + iisresetwasn't enough.

令人恼火的是,它需要完全重启才能开始调试;重新启动 Visual Studio +iisreset是不够的。

More info: I sometimes find that IE's cache is the culprit (strange but true). Therefore close allinstances of IE, start IE, clear the cache, close IE, then try debugging with Visual Studio again.

更多信息:我有时发现 IE 的缓存是罪魁祸首(奇怪但确实如此)。因此关闭IE 的所有实例,启动 IE,清除缓存,关闭 IE,然后再次尝试使用 Visual Studio 进行调试。

回答by pasx

I get this very often with a standard app - not a web application.

我经常使用标准应用程序而不是 Web 应用程序来解决此问题。

I have noticed that this happens when I change the properties of the startup project.

我注意到当我更改启动项目的属性时会发生这种情况。

Anyway my solution is:

无论如何,我的解决方案是:

  • Open the bin folder

  • Delete the exe, config and pdb for the startup project (my solution has scores of projects so I don't want to delete more than is needed there).

  • build the startup project

  • hit F5

  • 打开bin文件夹

  • 删除启动项目的 exe、config 和 pdb(我的解决方案有很多项目,所以我不想删除比那里需要的更多)。

  • 构建启动项目

  • 按F5

Very frustrating indeed...

确实很郁闷……

回答by Richard Pursehouse

  • In web.config, check you have: <compilation debug="true" />

  • If you have web.config transforms, ensure your environment you are building for in the drop down next to the run button has: <compilation debug="true" />(i.e. not <compilation xdt:Transform="RemoveAttributes(debug)" />)

  • On the property pages (right click on project -> properties), on the build tab from the left, tick "define debug constant", click the advanced button at the bottom and set output debug info to full. Then on the web tab on the left, at the bottom check that Debuggers ASP .NET is checked.

  • 在 web.config 中,检查您是否拥有: <compilation debug="true" />

  • 如果您有 web.config 转换,请确保您在运行按钮旁边的下拉列表中构建的环境具有:(<compilation debug="true" />即不是<compilation xdt:Transform="RemoveAttributes(debug)" />

  • 在属性页(右键项目->属性),在左边的构建选项卡上,勾选“定义调试常量”,点击底部的高级按钮并将输出调试信息设置为完整。然后在左侧的 web 选项卡上,在底部检查 Debuggers ASP .NET 是否已选中。

回答by Davinder Singh

Click on Tools -> Options-> Debugging -> General

点击工具->选项->调试->常规

Then uncheck the box "Require source file to exactly math the original version".

然后取消选中“需要源文件来精确计算原始版本”框。

回答by Rachel

Check if all debugging symbols are set on.

检查是否设置了所有调试符号。

Also see in which folder you have your DLL, lib, or bin files.

另请查看您的 DLL、lib 或 bin 文件位于哪个文件夹中。

回答by RepDetec

Try cleaning your solution. You might also blow away everything in the bin directory that your application is compiling to. Then rebuild the whole solution.

尝试清洁您的解决方案。您还可能会删除应用程序编译到的 bin 目录中的所有内容。然后重建整个解决方案。

回答by manji

Check for this option:

检查此选项:

*Property Pages* (right click project) → *Start Options* → *Debuggers* → *ASP.NET*

It must be checked to enable the debugger on your web pages.

必须选中它才能在您的网页上启用调试器。