简体   繁体   中英

The Breakpoint Will Not Currently Be Hit. No Symbols Have Been Loaded For This Document

I've Googled this particular problem, but cannot seem to find a working solution.

Symptoms: After adding a breakpoint in the codebehind for an aspx page in a web application project, the breakpoint displays in the margin as a hollowed out red circle with an exclamation point enclosed in a yellow triangle in the bottom right of the circle. When mousing over the breakpoint, the message "The breakpoint will not currently be hit. No symbols have been loaded for this document."

Note: I'm trying to hit the breakpoints by "attaching to [a] process", namely w3wp.exe, located on a remote computer.

Things I have tried.

  1. Recompiling other projects in the solution.
  2. Checking to make sure that the configuration for each of the projects and the website in the solution is set to "Debug" on "any pc".
  3. Closing the solution and restarting Visual Studio.
  4. Restarting IIS.
  5. Reattaching to the process (w3wp.exe).

I've been trying to hit the breakpoints using Internet Explorer version 9 and Mozilla FireFox version 4. In each case, the breakpoints are never hit.

Any ideas are welcome! Thanks!

Andrew

I run into the same problem and guess what? Just do it: At solution explorer, right click on Project -> Package/Publish Settings UNCHECK "Exclude generated debug symbols"...

Maybe it can't solve your specific problem but certainly it will save another people from suffering. I can't post a screenshot because I don't have 10 of reputation... :(

Like you guys I lost all day searching on google and stackoverflow and the problem was just that. I realized that when I saw the PDB file in the bin folder ready to be published becoming 0 bytes size when I clicked "publish"...

Are you deploying your assemblies to the GAC? If not, copy the .pdb file along with the .dll file, placing both in the same bin directory. The debugger should pick up the symbols automatically.

If you have more than one solution in your project.

Right click on your solution --> Properties

Set as --> Startup Project

This error produce by many reason, one solution is : its due to different framework version when you try to attach process. For more details, please visit: https://stackoverflow.com/a/13106908/1218422

I had the same problem, fixed it by switching the debugging method. I was clicking F5 with web project set to startup project (and the "Don't open a page. Wait for a request from an external applicaton" selected in project settings).

When I attached VS debugger manually to the w3wp.exe process using the debug menu it worked.

我意识到这是一个旧线程,但没有提到的一件事就是确保在web.config文件中启用了调试。

In my case I was trying to debug an ASP.NET Core app hosted in IIS. I noticed that when I published the app (dotnet publish) the generated web.config had this line:

 <aspNetCore processPath=".\MyService.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />

I had to attach to MyService.exe rather than w3wp.exe to debug the app even though it was running in IIS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM