Neil Barnwell
Neil Barnwell

Reputation: 42125

VS2010 Not Always Building Before Debugging

I have had a problem where VS2010 will not build my projects before debugging. Even when they have never been built before (i.e. on a fresh checkout from source control).

I will either find I am stepping through on the wrong lines of code (because the symbols are out of date), or an error message if there is no build output (bin\debug folder is empty).

Performing a build manually before debugging is the workaround.

Upvotes: 10

Views: 4295

Answers (4)

rory.ap
rory.ap

Reputation: 35280

What resolved the problem for me was going to the configuration manager and making sure the "Build" checkbox was checked. In my case, it had somehow become un-checked:

enter image description here

Upvotes: 1

Ravi Raj
Ravi Raj

Reputation: 13

Go to the configuration manager, and change Debug->Mixed CPU to Debug->Any CPU, I had resolved mine with the same option.

Upvotes: 1

Dron
Dron

Reputation: 1

Update: I've found your answer and checked a Tools->Options->Projects and Solutions->Build and Run And a value of "On Run, when projects are out of date" is "Prompt to Build", but VS does not prompt! But then I found a problem in "Configuration Manager" - for some reason a mark "Build" disappear. It happened to my projects when I create a some project based on some another one using a copying a files and changing a project's and solution's GUIDs, names etc. inside a proj/sln files manually.

Upvotes: 0

Neil Barnwell
Neil Barnwell

Reputation: 42125

I'm answering this myself, so that Stack Overflow can be the canonical answer to this problem in case someone else experiences the same thing.

Essentially it's a VS configuration issue. Navigate to the options as follows:

Tools->Options->Projects and Solutions->Build and Run->On Run, when projects are out of date:

and make sure it is set to "Always Build" if it is not already.

Hope this helps someone, it's caused me a lot of trouble for weeks now.

Upvotes: 26

Related Questions