C# VS2010 Entering break mode failed

Reid picture Reid · Aug 11, 2011 · Viewed 18.8k times · Source

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.

Answer

AMissico picture AMissico · Aug 11, 2011

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.