none
VS2005 VB.NET project not hitting breakpoints - symbols in not loaded

    Question

  • Hi,

    I've read a number of posts with regards to this topic, and none of the answers suggested in them have worked for me.

    I am running VS2005 on a Windows 7 64-bit environment. I have been running the same project on an older laptop with Windows Vista, and then Windows 7 32-bit for years without experiencing this problem. So I am not sure if it is occuring because of a change from the 32 to the 64 bit OS.

    The projects in the solution are written with  a mix of C# and VB.

    My project is using the .Net Compact Framework 3.5, and everything is running locally (I don't use any remote machines, etc). I am debugging the project on a Trimble Nomad Devices, running either Windows 6 or 6.1.

    When I start debugging, I get the "Breakpoint will not currently be hit. No symbols have been loaded for this document." warning on my breakpoints. If I go to Debug -> Windows -> Processes ->Modules, I see that the Symbol state for the .exe file says "no symbols loaded". If I right-click, and load symbols from symbol path, when I select the .pub file it tells me that "The symbol file does not match the module".

    I close VS, delete the .pub file and the .exe file from the Debug directory, and the breakpoints work again. The problem is that if I make any changes, I have to go through the whole process of closing VS, deleting the files and opening VS and the project again, which definitly leads to decreased productivity!

    - I've made sure that all projects in my solution are set to run in Debug, and not Release mode.

    - All my projects are set to build on run, so there are no outdated references to projects in the solution.

    - I've turned off the "Just My Code" option in Tools -> Options ->Debugging  -> "Enable Just My Code". Doesn't help

    - I have got a reference to the OpenNETCF dll, I don't know if that might have anything to do with this issue on the 64-bit version of Windows, like I said before I had no problem before I got my new machine with Win 7 64 bit.

    - In the configuration manager, under the Debug menu, I've set all the projects in my solution to "Deploy"

    This is really frustrating as everything worked perfectly before. It is not feasible to have to close the environment and delete the .pub file everytime that I want to make a change to the project.

    Wednesday, May 16, 2012 1:47 PM

Answers

  • Solution found.

    I simply deleted the user option files for the soultion and the project and then I deleted all the bin and obj folders. I had to delete and recreate all the project references in the solution too.

    This fixed the problem completely. The *debugger* seems to have a problem with one of these files when it has been created on a x86 system. It now hits the breakpoints each time that I run the project, without me having to delete the .pub and .exe files, and close and reopen VS.

    • Marked as answer by NickyK Monday, May 21, 2012 8:59 AM
    Monday, May 21, 2012 8:59 AM
  • Hi Jack,

    I've worked some more on this, and I found out that the .pdb file in the bin\debug directory an old file (it was created in a previous build, and does not seem to be updated). Even if I deleted everything in the debug directory, cleaned and recompiled my project, the pdb file would have an old timestamp on it (not the timestamp of the latest build). I found out that when I debug, the debugger uses the .pdb file in the obj/debug directory, which it copies to the bin/debug directory. I could not delete the .pdb file in the obj directory unless I closed VS, because it seems to keep the old file open in memory.

    The other workaround which I tried which works is to add a script to the pre-build event of my project, which renames the .pdb file in the obj\debug directory (you can rename the file, but you can't delete it!!??). It then forces the debugger to create a new version of the .pdb file in the obj\debug folder, which it then copied to the /bin/debug folder:

    if exist "$(ProjectDir)\obj\Debug\AxXis.pdb.old" del "$(ProjectDir)\obj\Debug\AxXis.pdb.old"

    if exist "$(ProjectDir)\obj\Debug\AxXis.pdb" move  "$(ProjectDir)\obj\Debug\AxXis.pdb" "$(ProjectDir)\obj\Debug\AxXis.pdb.old"

    This explains the problem that I described in the 1st post: "I see that the Symbol state for the .exe file says "no symbols loaded". If I right-click, and load symbols from symbol path, when I select the .pub file it tells me that "The symbol file does not match the module"." New build - outdated .pdb.

    It's ugly, but it also works.

    • Marked as answer by NickyK Monday, May 21, 2012 1:01 PM
    Monday, May 21, 2012 1:01 PM

All replies

  • Hi CoralLines,

    Thank you for posting in the MSDN forum.

    If you create a new project in this windows 7 64 bit, whether it could work well?

    Based on your description, the same app, it works in the windows 7 32 bit and windows Vista. So I’m afraid that this is a cross-platform problem, as far as I know, the 32-bit module cannot be loaded by a 64-bit process, and vice versa.

    So if possible, try to let your project work with “x86” or “Any CPU” platform target, and then Clean and Rebuild this project. Hope it could help.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Friday, May 18, 2012 5:22 AM
    Moderator
  • Hi Zack,

    Thanks for the response.

    I've tried it with a simple program started in the new 64-bit environment, and it seems to work fine. I added all the reference to the test project which I have in my main project, and it still worked. So I created a new project, and copied my forms, etc into it. I added all the references. When I ran it, it came up with the same problem.

    Is there anything that you can think of that I can try, without trying to recreate all my forms from scratch? The project is huge, and I dread the thought of having to create new forms and modules and having to copy the code into them!

    Thanks

    Nicky

    Friday, May 18, 2012 12:56 PM
  • The project is using the compact framework, so I can't run it using "x86". I am Deploying it to a Windows Mobile 6 Device. I have tried to clean and build, no luck.
    Friday, May 18, 2012 1:14 PM
  • Hi CoralLines,

    Glad to receive your reply.

    Since it works well when you create a new app, so I’m afraid that it is not the VS debugger tool issue, it is related to this specific app.

    Do you mean that it has the same issue when you change the platform target to “Any CPU”?

    The Breakpoint will not currently be hit. No symbols have been loaded for this document.

    In addition, whether this project is a web app?

    If it is a web app, if you set the <deployment retail = "true" /> in the machine.config file, you will disable the <compilation debug = "true" /> switch for every web application on the server. For detailed information, see this blog The Breakpoint will not currently be hit. No symbols have been loaded for this document.

    Reference:

    Why the debugger will not hit your breakpoints? Hope it could help.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Monday, May 21, 2012 3:37 AM
    Moderator
  • Hi Jack,

    If it is not a debugger issue, then why does the debugger break on the breakpoints the first time that I run the project, and not subsequently, unless I delete the .pub file, close the solution and reopen it? That sounds like there is definitly a problem with the debugger to me. I have checked this, and it occurs on all my projects that where created on my old x86 laptop, not just this one. There must be some problem that the debugger is experiencing when running projects created on a 32 bit machine. There must also be an easier solution than recreating the project from scratch.

    The project is not a web app.

    The project has always been set on "Any CPU"

    Thanks for the link to the blog and the site, but I don't see anything there that I haven't already tried.

    Thanks

    Nicky

    Monday, May 21, 2012 8:43 AM
  • Solution found.

    I simply deleted the user option files for the soultion and the project and then I deleted all the bin and obj folders. I had to delete and recreate all the project references in the solution too.

    This fixed the problem completely. The *debugger* seems to have a problem with one of these files when it has been created on a x86 system. It now hits the breakpoints each time that I run the project, without me having to delete the .pub and .exe files, and close and reopen VS.

    • Marked as answer by NickyK Monday, May 21, 2012 8:59 AM
    Monday, May 21, 2012 8:59 AM
  • Hi CoralLines,

    Glad to see this issue has been resolved and thank you for sharing your solutions & experience here. It will be very beneficial for other community members who have similar questions.

    Have a nice day,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Monday, May 21, 2012 9:02 AM
    Moderator
  • Hi Jack,

    I've worked some more on this, and I found out that the .pdb file in the bin\debug directory an old file (it was created in a previous build, and does not seem to be updated). Even if I deleted everything in the debug directory, cleaned and recompiled my project, the pdb file would have an old timestamp on it (not the timestamp of the latest build). I found out that when I debug, the debugger uses the .pdb file in the obj/debug directory, which it copies to the bin/debug directory. I could not delete the .pdb file in the obj directory unless I closed VS, because it seems to keep the old file open in memory.

    The other workaround which I tried which works is to add a script to the pre-build event of my project, which renames the .pdb file in the obj\debug directory (you can rename the file, but you can't delete it!!??). It then forces the debugger to create a new version of the .pdb file in the obj\debug folder, which it then copied to the /bin/debug folder:

    if exist "$(ProjectDir)\obj\Debug\AxXis.pdb.old" del "$(ProjectDir)\obj\Debug\AxXis.pdb.old"

    if exist "$(ProjectDir)\obj\Debug\AxXis.pdb" move  "$(ProjectDir)\obj\Debug\AxXis.pdb" "$(ProjectDir)\obj\Debug\AxXis.pdb.old"

    This explains the problem that I described in the 1st post: "I see that the Symbol state for the .exe file says "no symbols loaded". If I right-click, and load symbols from symbol path, when I select the .pub file it tells me that "The symbol file does not match the module"." New build - outdated .pdb.

    It's ugly, but it also works.

    • Marked as answer by NickyK Monday, May 21, 2012 1:01 PM
    Monday, May 21, 2012 1:01 PM