Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# VS2010 Entering break mode failed

I was having some problems with my breakpoints later in my program saying that they would not be hit because the source code and the compiled code was different. I decided to put a break point on my public MainWindow() function, and see what happened.

Now I get the error that Entering break mode failed for the following reason: Source file 'F:\cAdmin\OO\OO\MainWindow.xaml.cs' does not belong to the project being debugged.

I find this funny because my project is stored on my flash drive (L:) and not F:.

I have rebuilt my project and cleaned it (many times), restarted my computer, moved my Flash drive, and anything else that I can think of.

like image 225
Reid Avatar asked Aug 11 '11 05:08

Reid


2 Answers

Delete the solution user options (.suo) file.

If you experience "funny" debugging issues, it usually means the suo file is corrupt.

Delete the solutions suo file. This has fixed weird debugging problems with breakpoints every time for me. Note, you will lose your solution settings, such as bookmarks, breakpoints, and such.

See Visual Studio 2008 - The breakpoint cannot be hit.

like image 170
AMissico Avatar answered Sep 30 '22 01:09

AMissico


Visual Studio 2012 Update 3

Didn't work:

  • Rebuild Solution
  • delete .SUO
  • Delete Obj and Bin directories

Did work:

Tools->Options->Debugging->Edit and Continue->uncheck Edit and Continue checkbox

like image 40
Boris Geller Avatar answered Sep 30 '22 01:09

Boris Geller