Visual Studio 2010 doesn't rebuild changed code unless I manually select "Rebuild"

Visual Studio-2010Build

Visual Studio-2010 Problem Overview


In the past week or so, I've noticed that Visual Studio 2010 is not recompiling code unless I force it to. This is a C# 4.0 project with WPF. I hit F5, which seems like it used rebuild, if the code had changed, and then launch the app. Instead, it now says in the bottom left status bar "Build Successful" and launches the application. It doesn't actually rebuild the app, though. I can tell because:

  1. even if I make a large number of changes, it "compiles" very quickly and
  2. if I try to set a breakpoint, it gives the warning that the code has changed and doesn't set the breakpoint.

This happens regardless of whether there are errors in the code or not, so I don't believe it's the thing where it launches an older version if the build fails.

If I instead select from the menu to rebuild the project, it then works. This kind of impedes my usual workflow, however. I semi-frequently forget to do this, and then spend 10 minutes trying to figure out what the hell is wrong with my changes. Even worse, sometimes there are build errors that I don't notice right away.

Pressing F6 to "rebuild" the solution does not do anything either. What settings might I have mucked with that would cause this behavior?

Visual Studio-2010 Solutions


Solution 1 - Visual Studio-2010

Gah, I figured this out. It was naturally something stupid I did when messing around with build settings after a too-late night. Here are the things to check:

  1. Tools >> Options >> Project and Solution >> Build and Run >> Check that "On run, when projects are out of date" is set to "Always build" or "Prompt to build"
  2. Build >> Configuration Manager >> Check that "Build" is checked for all of the projects you want to build for each of the configurations you need to use.

Solution 2 - Visual Studio-2010

Also if multiple projects in solution, check configuration manager. If you have some projects "Any CPU" and some "x86", will be builded only projects of same arhitecture. Same with "Debug" and "Realese" config.

Solution 3 - Visual Studio-2010

Had similar issue in 2020 with VS 2019 (Community Edition) and WPF project not being rebuilt (deemed as "up-to-date") even though the referenced project was rebuilt. The above advice (Tools->Options and Configuration Manager) is met in many places, though didn't work for me.

Eventually changing .csproj file and adding the following line (under ProertyGroup) worked for me:

<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiondavidtbernalView Question on Stackoverflow
Solution 1 - Visual Studio-2010davidtbernalView Answer on Stackoverflow
Solution 2 - Visual Studio-2010user3585447View Answer on Stackoverflow
Solution 3 - Visual Studio-2010Maxim SaplinView Answer on Stackoverflow