Vakul's .NET Realm

My journey towards .NET World…

  • Details

    Vakuls MCPD Certification Vakuls MCTS Certification Author's Pic



Debugger problem “The breakpoint will not currently be hit. No symbols have been loaded for this document”

Posted by Vakul Kumar More on June 11, 2009


I just experienced the infamous “The breakpoint will not currently be hit”. After reading several posts in various websites in reference to this issue, I found few solutions which I thought of sharing :

  • Check if the debug=”true” in your aspx page.

Debug is disable

<%@ Page Language=”C#” MasterPageFile=”~/MainMasterPage.master” AutoEventWireup=”true” CodeFile=”Facility.aspx.cs” Inherits=”_Facility” debug=”false”%>

Debug is enable

<%@ Page Language=”C#” MasterPageFile=”~/MainMasterPage.master” AutoEventWireup=”true” CodeFile=”Facility.aspx.cs” Inherits=”_Facility” debug=”true”%>

  • Removing all the references in the project and re-inserting them taking care of the version used.
    Manually deleting the bin/release and bin/debug sub-directories in every project in the solution.
    De-installing and reinstalling .net framework (any version) and VS-2005
    Taking a close look at the target platform in the projects.
    Breakpoints Should come back !!It can be caused as the .PDB and the assembly of one of the controls would  not have been referenced at the     right place, resulting in a desync between the sources and binaries.
    By re-referencing all, and killing the bin subdirs problem will be solved.
  • Goto Tools menu and select Options; check the “Show advanced build configurations” checkbox.  Now the build configurations show in the Project Properties dialog;  display will be the Project Properties dialog (Project menu/Properties).  We can now see the Configuration dropdown box.  Select “Active(Debug)” item. Check the “Define DEBUG constant” checkbox.  Rebuilt the project.  Now there is a symbols file ([project].pdb) in the current output directory. When debugged, the symbols file is loaded and breakpoints will now hit.
  • Other options than can be tried are  1).  rebuilding the application many times. 2). completely deleting and redoing it from scratch (though thats not a good idea !!  ). 3).  Check whether the .pdb file is in the same location as the DLL with the same name and time. 4). Check whether project is running on the debug version of the DLL and associated files. 5).  ensured there was only one instance of the DLL, project, etc. on the machine. 6).  right clicked on a DLL that is within the Modules window, selected Symbol Settings, selected Debugging | Symbols and manually added the directory with the .pdb file – even though confirmed that this is the default location used by the project. 7).  checked that Enable Just My Code is not selected within the Symbol Settings | Debugging | General menu. 8).  tried placing the DLL in the C:\Windows32\ directory just to see if the Modules Window would “see” it. 9).  adjusting a few other things to match suggestions regarding optimization settings, etc. 10). selecting Load DLL exports within within the Symbol Settings | Debugging | Native menu (although I am not familiar with what this may actually be doing..needs some research in the weekend); this caused most of the DLL’s in the Modules window to have a listing of Exports Loaded, but did not appear to affect my issue in any way – again my DLL is not within the Modules window.
  • Select the Solution node in your Solution Explorer… Select Properties from the context menu… Select Multiple Startup Projects…For each project you want to debug, select Start from the action drop down.

Received a comment from Eric Long with an other solution: click here .

Advertisements

26 Responses to “Debugger problem “The breakpoint will not currently be hit. No symbols have been loaded for this document””

  1. RRaveen said

    Dear Friends,

    I hope you are doing well. I have launched a web site http://www.codegain.com and it is basically aimed C#,JAVA,VB.NET,ASP.NET,AJAX,Sql Server,Oracle,WPF,WCF and etc resources, programming help, articles, code snippet, video demonstrations and problems solving support. I would like to invite you as an author and a supporter. Looking forward to hearing from you and hope you will join with us soon.

    Please forward this email to all of your friends who are related IT. Send to us your feed about site also.

    Thank you
    RRaveen
    Founder CodeGain.com

  2. Patrick said

    Hi,

    I have a VB.NET 2005 web project and it’s not going into debug mode. I have tried all the suggestions that you made in your post yet, nothing helped. I have reinstalled VS but the problem still remains. I noticed that once I run the project, the interdev’s RUNNING tag disappears thus loading the project on IE8 independently. Also, i noticed this when my IE has been upgraded to IE8. Is there a connection or flaw between VS 2005 and IE8?

    Many thanks,

    PATRICK

  3. John said

    I was having this trouble with a Silverlight application in Visual Web Developer 2008 Express. I did:

    Build > Clean Solution
    Build > Rebuild Solution

    and that got me my breakpoints back.

  4. I saw your blog when I was searching for something else, but this page was one of the first sites listed in Bing, your site must be incredibly popular! Continue the awesome job!

  5. Phil said

    To load the debugging symbols for the Web Project, that is within a largly Winform solution.
    I deleted the relevant BIN Directories, including the temp folder in c:\inetpub. (this may have not have contributed to the fix, but is included for completeness)

    Then in the project that eventually makes calls to the web project, under properties, Debug tab, check “Enable unmanaged code debugging.”
    Rebuild project.

    Launch. A dialog box appears.
    “The security debugging option is set but it requires the Visual Studio hosting process which is unavailable in this debugging configuration. The security debugging option will be disabled. This option may be re-enabled in the Security property page. The debugging session will continue without security debugging.”

    A quick search finds a VS 2005 bug ticket dated 2007. So this issue has been around for at least 5 years.

    Then viola. (note small text, if this was 3 days ago I would have been happier)

  6. Excellent blog! I genuinely love how it’ s easy on my eyes and also the details are well written. I am wondering how I could be notified whenever a new post has been made. I have subscribed to your rss feed which should do the trick! Have a nice day!

  7. […] Debugger problem "The breakpoint will not currently be hit. No symbols have been loaded for thi… […]

  8. luke said

    I’m using vs 2010, I had the same problem, non of the above worked for me.

    I opened up the property pages and set the use custom server to http://localhost:xxxx

    This might not work of you it did work for me

    The settings I currently have in Debug > Options and Settings > Debugging > Symbols

    Microsoft Symbols Servers is checked.

  9. Anni said

    I followed your instructions. Break points turned from hollow to solid red. But still I can not step into the code.

  10. Eric Long said

    This solution is as good as the help desk telling you to reboot. Th correct solution and explanation can be found here http://blogs.msdn.com/b/dsvc/archive/2010/06/15/vs2010-unable-to-hit-breakpoints-in-managed-code.aspx

  11. cheche said

    can i ask i don’t what is wrong w/ my c# because when i debug it , it’s not showing what i am edited or code in my forms it’s shows the project i did recently like what i am did last yesterday ..the yesterday project is running not the project i did now..please project help i don’t know to fix it i can’t finish my project if i will repeat it because i did it 3 times it same problem..
    THANK YOU VERY MUCH..

    • Try to check the IIS process is running in the background. Then try to clear the cache in the browser you are testing (IE). If all this wont help, try to restart IIS. As a last step, clean the solution and rebuild. Let me know if it works.

  12. asp.net, c#,javascript…

    […]Debugger problem “The breakpoint will not currently be hit. No symbols have been loaded for this document” « Vakul's .NET Realm[…]…

  13. Jack said

    Jack…

    […]Debugger problem “The breakpoint will not currently be hit. No symbols have been loaded for this document” « Vakul's .NET Realm[…]…

  14. Tony said

    Hey guys,

    This happened to me too and it took a few days to suss out.

    In my solution I have a Website project and a assembly (dll) project. The Website references the dll project and pulls it in on the build.

    When I hit debug I was getting the very stubborn “breakpoint will not be hit”.

    My solution…

    because I am in a TFS source controlled solution, when you go into debug, the Website gets compliled, during the compilation in pulls in the reference dll’s. Because I have not “checked out” my dll proejcts .pdb file, it cannot get exlcusive access to write to it. Once I check it out, bingo.

    So, if you are using source control and you are referencing other projects in your solution, make sure you have the .pdb files checked out for all projects. Run your debug and you should be grand.

    Cheers 🙂

  15. Beginner said

    I have the same problem and just get it fixed. What I do is just a simple step. Change the Platform to Active (Any CPU).
    My experience initial project was in Platform Active (Any CPU), it was fine that time. After I change to the Platform to x86, the debugger is not working.

    So, what I do I change it back to original is working fine. But when i need to build the setup file, I need to change it back to x86 due to certain reasons.

    Note:
    All the while my project Configuration is in Active(Release). I did not change it.

    Hope it help you all 🙂

  16. venu said

    Hi there, This is Venu. I get the same problem in C# Windows Application.. Could you guide me….

  17. jbb said

    Thank you ! I lost one clock because of this !

  18. mehamada said

    the good solveing for taht is
    – close visual studio
    – goto the solution folder, and choose obj folder and remove all its contents
    – run visual studio agan,
    that’s all

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: