Can't debug - “The breakpoint will not currently be hit. No symbols have been loaded for this document”

前端 未结 6 1326
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 08:04

I\'m getting the error in the subject line. I\'m running vs2k8 on server 2k3sp2. I\'ve tried deleting the pdbs, cache directories, verifying that debugging is set up on the

相关标签:
6条回答
  • 2020-12-29 08:13

    I usually see this error pop up when I am working with two separate web 'sites'. I have a web front end and a web service back end. If the development server isn't running for the 'site' the code file is for, then you will receive that error message.

    This may not be your problem exactly, however this is usually the situation when I see that error message. Another thing you can do is Debug -> Attach to Process if the debugger isn't attached to the correct process.

    0 讨论(0)
  • 2020-12-29 08:22

    If you have a "WebSite" project, rather than "WebApplication", I've found that overlapping code file classes can cause the issue. There are a few ways this can happen. Unfortunately Visual Studio still seems to compile the solution/project without error.

    1. Moving pages between folders on the web site.
    2. Source control merging after moving pages can cause pages to be duplicated and Visual Studio gets confused during debugging.
    3. Copy and pasting existing pages (templates) could also cause this from memory.

    To resolve the issue I

    1. Search for "Class TheProblemPageCodeSymbolIssue" for duplicates in the solution.
    2. Re-factored those duplicated code behind class names and tested all those pages, to ensure I could use debug breakpoints.

    Hope that helps.

    0 讨论(0)
  • 2020-12-29 08:28

    Place an inline break statement to be sure you are actually running the code. If you do not stop then it is likely the code you are attempting to debug is just not being run, or you are not debugging it with a managed debugger.

    If you do stop but cannot find source, then you likely do not have a pdb for the module. Check the top of the callstack window to see which assembly contains the method you stopped in. That is the assembly for which you need a pdb. The module window will show the location on disk of that assembly. The command line tool "dumpbin -headers assembly.dll" will dump the PE headers. Check the Debug Directory to see where the pdb was placed when the assembly was built. If the Debug Directory does not exist then the assembly was built without debug information. If that is the case your problem is then to determine why that specific assembly was built without debug info. If it did have debug information and a pdb exists, but is not being loaded then it means either the pdb wasn't found by the debugger and you should look at the tools\options\debug\symbol settings. Or the pdb and assembly do not match. If the timestamps are not within 1 sec then they certainly don't match.

    If the above doesn't help please update with more information.

    0 讨论(0)
  • 2020-12-29 08:34

    Usually this happens when the .pdb files that VS is using for debugging are different than what the code is actually executing. That is, if you have made changes to your assembly.
    Also, make sure that you have <compilation debug="true"> in the web.config. I don't know if it has any bearing on the page directive, but that's usually what does it for me :)

    0 讨论(0)
  • 2020-12-29 08:35

    I agree that I have seen this when I have multiple assemblies that are out of sync and/or one or more pdbs do not match the source. In my case, it was because I had a weirdness with my version control software (ClearCase) and I was not actually compiling what I thought I was.

    0 讨论(0)
  • 2020-12-29 08:36

    The only time I've ever run into an issue like this is if I was trying to debug while the project was in release mode.

    0 讨论(0)
提交回复
热议问题