The breakpoint will not currently be hit

I was hit with the dreadful "The breakpoint will not currently be hit" problem this week.  Searching the Web, looks like it is a common problem both with VS 2005 and 2008 however, it was the first time I experienced it.

The symptom
You have a solution with a client project and a Web or WCF project.  You place breakpoints in both projects so you can step thru the code on both side.  You break in your client code but you can’t jump in the Web/WCF code.  When you look at the Web/WCF breakpoint while debugging, the red dot displays an exclamation mark and this message: "The breakpoint will not currently be hit".

 BreakpointWillNotCurrentlyBeHit.jpg

The solution
Looks like there are many solutions to the problem.  Here’s what I did:

  • Checked that VS was not in release mode.  Nope, I was in debug mode.
  • Deleted the \bin\debug folders.  No good.
  • Deleted both the \bin\debug and \obj folders.  No good.
  • Deleted all source code and retrieved everything from source control.  No good.
    Out of three developers, I was the only one with the problem so I checked if my VS debugging settings were changed.  Nope, we all had the same settings.
  • Tried to reset my settings anyway with devenv /resetsettings.  No good.
  • Started a new solution with a simple WCF project and a Console app client.  No good, same problem so it's really VS, not the code.
  • Tried a VS repair.  No good.
  • Uninstalled and reinstalled VS completely.  Bingo, it worked!

The problem
I have absolutely no clue.  Anyone has an idea on why this problem happens?

12 Comments

  • you might have the assemblies left over from a previous version of the same project. The best thing to do in this case is to delete the contents of the
    "Temporary Asp.Net Files" found at this location : %windir%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\

    and also , if you are running in cassini, stop and start cassini so that it loads the new assemblies.

  • Guy, I've had this before. Usually deleting the .suo file in the solution folder fixes it.

  • you should post this to stackoverflow.com...not a bad forum to place this in

  • When I get this I just have to debug via attach to process. Instead of hitting F5.

  • Hi,

    this has occurred to me many times in VS2005. The problem is not in your source code or anything like installation of VS. IMHO it has to do with the Temporary ASP.NET folder under the .NET Framework versions folder in C:\Windows. Some old code still hangs in there and is pointed to, probably from IIS or the webhost from VS itself. Cleaning up this directory has always been sufficient for me, in combination with a complete rebuild of the code.

    I just thought I'd let you know.
    Regards,
    Meile

  • I have no idea, but I'm having the same issue, and like you none of the proposed solutions that I've read about have worked at all. Looks like it'll be an uninstall/reinstall for me.

  • it got me... I tried everything above and still can't get the breakpoint to work. Looks like I'm going to have to go back to the ol Response.Write.

  • Closing the project, delete the .suo file, and re-opening the project worked for me.

  • Yup, delete the .suo file did the job for me (Silverlight 2.0 app). Thanks man!

  • "Temporary Asp.Net Files" found at this location : %windir%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\

  • delete the .suo file which is in .sln folder


    it worked for me
    :-)

  • Clearing Temporary ASP.NET files at %windir%\Microsoft.NET\Framework\v4.0.30319 worked for me

Comments have been disabled for this content.