Problem: The breakpoint will not currently be hit. No symbols have been loaded for this document

Hi,

I've run into a problem that seems to defy a solution. Bottom line: When I'm attempting to debug with VS 2005, I cannot set an effective breakpoint in one of the source files. The breakpoint is the hollowed-out reddish/yellow circle, and VS says that the breakpoint won't work because the symbols are not loaded. I've found several discussions in this forum about this type of problem, but there's no concensus that I could find on how to solve the problem.

Some background might be in order. I have been developing a "data binder" for use in a forms UI application that has multiple threads. There are three projects/classes in the solution, one for a test mainline, using forms, one for a general-purpose "dump" routine, and a "binder" class that implements the data binding. I had been developing this on Vista, using VS2005 but gave up on Vista (because of the horrible security stuff, the fact that I can't get a Windows Explorer to display right, among other problems) and reloaded XP Pro. In then attempting to continue my development/debugging, I loaded up the "TestBinder" solution, which includes the Forms UI main, the "dumper" class and the "binder" class. On Vista, my development and debugging never had the problem I am now having on XP. For what it's worth, the source for the "binder" class (binder.cs) shows a little blue "readonly" flag on the VS tab, which may be related to the problem. I have no idea why VS says "readonly", as I can save the file from VS, it has a correct "owner", it's doesn't have a file attribute of "readonly", it's in the same set of directories as the rest of the "solution", etc. Anway, the "readonly" indication on the VS tab may or may not be connected with the problem.

From reading various newsgroups, the meat of the solution seems to be to be sure and erase everying, including directories, in the xxx/bin and xxx/obj directories, and rebuild. I've done this, with the same results. I've also discovered from this forum that one should look at the "modules" to see if the symbols are getting loaded. This is where the first confusion factor comes into play, since when I look at the "modules" that were loaded during the start of the debugging session in VS, it shows two entries for my TestBinderApplication, one showing symbols loaded, one showing symbols not loaded; I can't ascertain from this what's really happening:

other stuff===========

TestNewBinder.vshost.exe D:\TestBinderHelper\TestBinderHelper\bin\Debug\TestNewBinder.vshost.exe Yes No Skipped loading symbols. 7 8.0.50727.42 9/23/2005 3:27 AM 00400000-00408000 [600] TestNewBinder.vshost.exe: Managed

other stuff===========

TestNewBinder.exe D:\TestBinderHelper\TestBinderHelper\bin\Debug\TestNewBinder.exe No Yes Symbols loaded. D:\TestBinderHelper\TestBinderHelper\bin\Debug\TestNewBinder.pdb 10 1.0.0.0 8/10/2006 2:23 PM 01020000-0102A000 [600] TestNewBinder.vshost.exe: Managed

Also, in the "output" window from VS, it has entries showing symbols being loaded for the TestApplication and a third class/project I'm using, but there is no entry for the "databinder" class/project:

'TestNewBinder.vshost.exe' (Managed): Loaded 'D:\TestBinderHelper\TestBinderHelper\bin\Debug\TestNewBinder.exe', Symbols loaded.

'TestNewBinder.vshost.exe' (Managed): Loaded 'D:\TestBinderHelper\TestBinderHelper\bin\Debug\Odumper.dll', Symbols loaded.

It's obvious from these two messages that the symbols are not getting loaded for the Binder.dll, the third project/class I'm using in VS. I've tried turning the "Enable Visual Studio Hosting Process" option in the DataBinder/properties/debug menu on and off and it seems to make no difference.

With respect to the "readonly" flag on the VS tab for the source, it gets set when I do the "start (with debugger"). If I remove all the "bin" and "obj" directories for the main and the databinder, the readonly flag goes off, but as I said, it comes back on when I start the debugger.

I've gone so far as to completely build a new directory structure, a new solution and 3 projects, using only "copied" .cs source files from the old directory, but still it doesn't solve the problem.

I'm at my wits end. I'm hoping someone can give me some idea or has some insight as to what to do. Based on what I've seen in the forums and what I've seen so far, it could be a VS2005 problem, but I'm not ready to blame VS yet.

Thanks, Tom



Answer this question

Problem: The breakpoint will not currently be hit. No symbols have been loaded for this document

  • New-Bee

    I've now retried building the entire solution several times .. carrying over nothing but the .cs files .. still the same. However, I did 'unload' the entire directory structure using winzip, carried it back to the Vista machine, unzipped it on there and it worked! I don't understand. It has something to do with VS2005, but before I went to the Vista machine for development, it worked fine on this machine. It's got me buffaloed!

    One thing that might be figuring into it is the MP (AMD 64-bit X2 running as 32-bit X2). There's a tremendous amount going on, and many of the 'symbols loaded' messages come out AFTER the code is already running. In fact, if I switch fast enough to one of the source files that are 'later' in getting loaded, then I get the 'red/yellow circle' for a brief instant before the symbols are loaded and it becomes a solid red(maroon) circle.

    Microsoft, this is over a week old now ... have you looked at it yet All the source files, VS2005 files, etc., are in the .zip file that I sent you with the initial problem report. I'm essentially dead in the water with debugging until you can solve this problem for me. I've done everything I know how to do. I've even taken the .zip file (that I created to go to the Vista machine, which worked OK), reloaded it on the development system (XP SP2+) and it's still 'broken'. But, alas, I don't know how to 'break' it or fix it ..

    Thanks, Tom


  • IS dude

    When I changed the Debugger Type/Debugging/DLL project Peopreties, I could hit the breakpoints in the DLL source code.
  • Fahad Hanif

    Your program needs to be deleted out of the assembly cache. Use mscorcfg.msc for .net 2.0 for this. Once deleted and you run in debug mode in visual studio your breakpoints will work. (Half of program is this .net security crapola, heck alot quicker and easier in vb 6!)
  • Lawrence 007

    could you please be more specific - how can I get to these settings

    Thanks!


  • Mikhail Matveev

    I had this problem before (with mobile development) and had to basically create a new blank solution and a new blank project then add all the files into this - turned out the project file/solution became corrupted/invalid some how

    have you tried this



  • twonjosh

    Have you tried just doing an iisreset

    start / run / cmd / iisreset


  • Alvin Kuiper

    Not sure if this will help, but I could not hit breakpoints on Windows Vista. That was until I ran Visual Web Developer as an Administrator (right-click on file >> run as Administrator). This appeared to fix my problem.

    Hope this helps.


  • Manaxter

    Anson,

    Thank you so much for the reply. I had given up and was just going back and cleaning up things when I found your reply; I apologize for not having looked sooner.

    Anyway, the information you provided was extremely helpful to me. If this happens again in the future, I'll be much more prepared to deal with it because of what you wrote.

    I, also, could not find the .zip file that I had uploaded; I don't know what happened to it. I also looked in my files to see if I still have it, to forward it to you to satisfy both your and my intellectual curiosity, but somehow I've disposed of it. However, with respect to the problem, I ultimately solved it by manually copying over each and every .cs file and recreating the various resource and settings files from scratch, and voile, the problem was gone; It hasn't come back nor have I been able to reproduce it.

    Nevertheless, I can't thank you enough for taking the time to significantly add to my knowledge.

    Thanks, Tom


  • vtortola

    I am experiencing this problem with an application that I am creating for Windows Mobile 2003 PocketPC version. Visual Studio is running under Windows XP on an AMD X2 64 in 32 bit mode. How do I solve it here

  • OmegaMan

    Thanks for the feedback.

    Yes, I tried that, but I'm not sure that I didn't get the new solution "cross-polinated" with the old. I'm getting ready to try it again, being even more sure that I don't get any of the old solution.

    Thanks, Tom


  • XNA Rockstar

    I have the issues of not hitting the breakpoints on Windows Server 2003 / Visual Studio 2005 TS edition with an ASP.NET application, Web Services, and back end business sevices dlls. What I found was the problem was with the object caching of the web services and object calls from the web site in the C:\<SYSDIR>\Microsoft.NET\Framework Version\Temporary ASP.Net Files.

    It seems that when you are debugging the application, these files get updated with pdb and other object information, and upon a clean or rebuild of the solution, they may or may not be updated. Which will cause the unable to hit breakpoint / no symbols for document loaded issue.

    Be sure to stop your web server ( NET STOP "World Wide Web Publishing Service") as well as stop any Cassini web servers you may be running. Delete these directories under the temp file folder. Clean and rebuild your project, and you should now be able to debug.

    Good luck all.



  • RajeshPKumar

    Tom,

    I'm not sure if you're still reading this thread (given how long it's been!), but I hope you are. Let me try sum up the information that has been posted on the thread as well as try to explain a few of the things that you're seeing. I can't tell what the problem is off hand, but hopefully some of the questions below will help us track it down. By the way, I looked around for the .zip file that you mention in a later post, but I couldn't find it.

    First, as I'm guessing is already clear, the debugger refers to the information stored in a "pdb" file as either symbols or debugging information depending on the time of the year. The PDB file contains a hash which is used to verify it against the assembly (say, binder.dll). If the hash doesn't match, the symbols will not be loaded, and you won't be able to set breakpoints. There is an option in Tools | Options | Debugging | General called "Require source files to exactly match the original version," which controls whether or not the hash is verified. If you turn this off, and it's then possible to set breakpoints, the problem has to do with the debugger thinking that the files/assembly has been changed after the .pdb has been built (this could happen if you run an obfuscator that doesn't fix up the .pdb file, for example).

    The read-only marking that you're seeing in the editor when you start debugging your application is unrelated. The files are set to read-only if you have Edit and Continue enabled. Edit and continue only allows modifications to be made when you're stopped (the read-only marker should go away when you do hit a breakpoint in some file).

    The output window should, at some point, contain information about binder.dll. What does that line say If you don't see any line for binder.dll, even after you expect that you've executed something from it, then it's unlikely that it's actually being executed (or that there's an extremely heinous bug in the debugger). It's fine if this is loaded after you've started debugging, as someone mentioned assemblies are loaded when you start accessing state or calling methods on them. If you use reflection it won't be loaded until you call Assembly.Load.

    If I could see the .zip file I might be able to help more. You can send it to me at ansonh@microsoft.com.

    Anson



  • Ljhopkins

    I found a solution to this problem.

    I had this "no symbols" problem appear on a website that had been operating (and stopping at breakpoints) normally. After making a change, the "no symbols" problem started. The website would compile, but I could not set breakpoints in it. The website was part of a larger solution (4 websites and 16 supporting class files). Incidentally, the change was disconnecting the bin folder from Source Safe (for some reason, VS2005 writes the bin folder to SS).

    Anyway, what worked for me was this:

    1. Open the website in a new solution.

    2. Run the website. A message will appear along the lines of "The website is not set for debug. Would you like to edit the web.config to allow debug "

    3. Click "Yes".

    4. The website will now run.

    Although my problem occurred with a website, a similar solution may work with other types of projects.


  • dakota367

    Keep in mind that .NET assemblies don't get loaded until your code references a class in that assembly. That's why you see 'symbol loaded' debugger messages after your code started running. The obvious explanation for what you're seeing is that your program runs along a different code path on Windows XP and just never references a class in Binder.dll. To make sure, use Debug + Windows + Modules. If you see your Binder.dll listed here, then there's a problem. If not, set breakpoints in your code to see why the Binder.dll classes don't get referenced.


  • Problem: The breakpoint will not currently be hit. No symbols have been loaded for this document