9

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

Andrew
  • 93
  • 1
  • 1
  • 3
  • Could this type of problem occur by caching symbols in the wrong directory? I tried to fix this by changing the "Cache symbols in this directory" field in the Tools -> Options -> Debugging -> Symbols window in Visual Studio, but the problem didn't go away... – Andrew Apr 26 '11 at 21:07

7 Answers7

5

If you have more than one solution in your project.

Right click on your solution --> Properties

Set as --> Startup Project

Ranjith Kumar Nagiri
  • 865
  • 3
  • 18
  • 42
4

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"...

4

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.

Kyle Trauberman
  • 25,414
  • 13
  • 85
  • 121
  • Thanks for the response! How can I determine which assemblies need to be loaded? The popup message over the breakpoint only indicates that no symbols have been loaded, and I'm trying to debug an aspx.vb file which is part of a web application (web applications don't create assemblies, right?). Also, there are a number of .dll files in the bin directory, but only one of them (which is the result of another project in the solution) has a pdb file. Does this make sense? – Andrew Apr 27 '11 at 13:44
  • Web Applications create assemblies, Web Sites don't. If you right click on your web application project in the solution explorer and choose "deploy" VS will pre-build everything for you and copy it to a location you prefer. I think this included .pdb files. If not, they can be found in the bin directory of your application after it is built. – Kyle Trauberman Apr 27 '11 at 14:09
  • Thanks again Kyle. I think this might be a website as opposed to a web application. There doesn't appear to be a deploy option when I right click the name of the site in solution explorer... Also, it might be worthwhile mentioning that building the website results in the error ": Build (web): Failed to start monitoring changes to '[website directory]' because the network BIOS command limit has been reached. For more information on this error, please refer to Microsoft knowledge base article 810886. Hosting on a UNC share is not supported for the Windows XP Platform." – Andrew Apr 27 '11 at 14:29
  • 1
    Thanks so much for your responses, Kyle! As a result of your ideas, I ended up learning much more about debugging, and now feel more comfortable using Visual Studio. It was just pointed out to me by a coworker that the problem was actually being caused by the Debug page attribute for the aspx page being set to "false" (something I completely overlooked:(((.) But thanks again, your responses are helpful! – Andrew Apr 27 '11 at 15:10
2

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.

Bartosz Wójtowicz
  • 1,321
  • 10
  • 18
1

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

Community
  • 1
  • 1
Bhaumik Patel
  • 15,176
  • 5
  • 30
  • 33
1

I realize that this is an old thread, but the one thing that nobody mentioned was to make sure that debugging is enabled in the web.config file.

Lee Z
  • 802
  • 2
  • 13
  • 39
0

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.

Wilkoteq
  • 101
  • 1
  • 4