2011
08.18

Breakpoint Wont be Hit in Visual Studio 2010

I’ve been working on a 3D VideoGame prototype these last months, using Visual C++ (Visual Studio 2010). With such work, some vacancies and some job affairs I havn’t had enough time for publishing something interesting in the blog…

Visual Studio 2010 worked fine at the beginning, but one day, suddenly, breakpoints stopped working. A yellow exclamation mark symbol was shown over them and placing the mouse cursor over such symbols showed the message “Breakpoint won’t be hit”.

Searching on the internet for this problem I found out it was a common one in almost every version of Visual Studio, specially in 2008 and 2010. Most common causes for this error are:

• The project was compiled in Release mode, not in Debug one
Removing these lines from the .vproj file and recompiling made the breakpoints to work again! The case was these lines referenced User configurations that didn’t appear in my VS configuration panels or couldn’t change (some of them were grayed). These XML lines contain a conditional inclusion and the path is $(UserRootDir)\MicrosoftCpp.$(Platform). It happened that path was C:\Users\Boriel\AppData\Local\Microsoft\MSBuild\v4.0, which was not the Visual Studio configuration Folder. Deleting it fixed the issue (it’s regenerated the next time Visual Studio IDE is started).