Reputation: 2789
I'm trying to understand why I get the "The breakpoint will not currently be hit. No symbols have been loaded for this document" message, when try to debug my web site application (note: no web application, in case it matters)
So far I found out that the pdb (project debug database) file is as important as the source code, and it should appear in the bin folder, but for whatever reason the file is missing, just some dll's are placed there, actually there is no pdb file in the entire directory.
My first question is: There should be a pdb file regardless whatever the kind of project that is being developing. Correct?
Second question: How can I re-create that file again, or what steps needs to be done in order to debug the project again?
Upvotes: 3
Views: 15528
Reputation: 515
Further to Resource's answer above, even though I am running debug versions, I had to set the Release version of the project to debug (in my case a NuGet package) to 'pdbonly' as well. I'm also using MyGet as a symbol server, but doing this I can also debug using local versions. I have the following setup:
Release versions uploaded to MyGet NuGet package server Debug versions uploaded to MyGet Symbol server
Upvotes: 0
Reputation: 544
To generate .pdb files in Release, you need to set your project's properties:
Compile\Advanced Compile Options\Generate Debug Info => 'pdb-only' or 'Full'
Package/Publish Web\Exclude generated debug symbols => untick this
Upvotes: 2
Reputation: 6273
I just had this problem, and it turns out my web.config was set to debug=false.
Make sure that compilation debug=true in your web.config
<compilation defaultLanguage="vb" debug="true" batch="false" targetFramework="4.0">
<assemblies>
<!-- add references to gac assemblies here-->
</assemblies>
</compilation>
Upvotes: 1
Reputation: 4099
Couple of things I do to try to correct this problem:
Usually if I do this, then attach to the W3WP process to debug, the breakpoint will be filled in and I can step through my code.
Upvotes: 5
Reputation: 2789
In my quest for a solution to my problem I found this:
First, like Adrian Iftode said, in the Web site case, the code behind files are compiled by ASP .Net, not by the VS, so there are no dll and pdb files in bin folder.
which contains a folder for every project you have.
By doing all the above, I was able to debug my website again.
Upvotes: 0
Reputation: 3735
You have to have compilable code to get the pdb. It sounds like you do.
Usually what is happening is that you have setup your build to be "Release" instead of "Debug".
http://msdn.microsoft.com/en-us/library/wx0123s5.aspx
If you are creating a web application, your configuration files might also have a "Retail" setting. If set to true, you are always in "Release" mode, even if it says otherwise in your build configuration.
http://msdn.microsoft.com/en-us/library/ms228298(v=vs.80).aspx
Upvotes: 7