Why is Visual Studio always rebuilding some projects?

By , last updated September 27, 2019

Visual Studio or VS is my weapon of choice.

But sometimes, it’s stupidity can’t be expressed with words…

The problem

Sometimes, Visual Studio will always rebuild projects, even though they have recently been built and there are no changes. If you build, and then run the project will build. If you haven’t disabled the “projects out of date”-dialog, it will pop up and ask you to rebuild.

Within VS, it will match a set of rules to figure out if a project is up to date or not.

Here is how to find out what rules are causing a project to always build.

This applies to both C# and C++ projects.

How to identify the problem.

The simplest way to discover this problem, and probably the most annoying about this is this popup box when running the project (unless you’ve disabled this dialog).

Project out of date popup Visual Studio

Another clue is output text. Regardless how many times you build the project, it’s never up to date.

1>------ Build started: Project: always-build, Configuration: Debug Win32 ------
1>  always-build.vcxproj -> R:code-samplesvisual-studio-always-buildingDebugalways-build.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

The first dialog will only show when “prompt to build” is selected.

Build and run options visual studio

How to fix the problem.

Open devenv.exe.config as Administrator. Default path for VS2013 is C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDEdevenv.exe.config.

Add this section to the configuration file.

    <add name="CPS" value="Verbose" />

About here:

denenv exe config visual studio

Restart VisualStudio.

Download and run DebugView from Microsoft (https://technet.microsoft.com/en-us/library/bb896647.aspx).

Build the project.

In DebugView, you’ll see many lines of diagnostics information. One line in particular is the interesting one, that’s the line with not up to date because. If you can’t find that line, select the top line and hit Ctrl-F to open the search dialog, and search for not up.

debugview diagnostics lines

In this case, it’s because it’s missing a file referenced in the solution, [9300] Project 'R:code-samplesvisual-studio-always-buildingalways-build.vcxproj' not up to date because build input 'R:CODE-SAMPLESVISUAL-STUDIO-ALWAYS-BUILDINGNON-EXISTING-HEADER.HPP' is missing.

Remove that file from the solution, and try to rebuild.

When you get this text from the output window, you’re successful.

========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========

Just don’t forget to revert / delete the diagnostics settings in devenv.exe.config

The project and code from this post is available at GitHub.


  1. Paul Stanton August 27, 2015 Leave a Reply

    Putting in the change to devenv.exe.config caused Visual Studio 2010 to work correctly for me… So the diagnostic fixes the issue so I can’t figure out where it comes from… Oh well.

  2. Shane Gannon February 17, 2016 Leave a Reply

    Useful tip but after correcting 20 problems with missing files and incorrect outputs I’ve not improved the build speed. At this point I’d like to apply the same CPS verbose setting to msbuild (which is what out build servers use).

    But I’m having a hard time finding how I can do this. I tried setting the above in msbuild.exe.config. But I’ve been unable to save the changes. Even when I run my editor as an Administrator I get an access denied error.

    Any suggestions on how I can get this information when running mbuild instead of Visual Studio? Is there a command line option?

    • Ofek July 5, 2016 Leave a Reply

      Tools->Options->Projects and solutions->Build and run ->
      ‘MSBuild project build output verbosity’ = Verbose

  3. John Norris December 1, 2016 Leave a Reply

    Same problem for VS2015. Seems to be a VS-virus M$ cannot fix.

    None of the above seems to work. I have also tried to kill all intermediate files. No good. Problem persists.

  4. Carl Stehle September 1, 2017 Leave a Reply

    In my case (VC2010 Express, Win 7), doing a ‘Clean’ resolved the problem.
    But this problem only occured after a hard crash (blue screen).

    • Serge February 23, 2018 Leave a Reply

      Confirming this. VS2017 Community, native C++ solution, Win 10, cleaning the whole solution also resolves the problem for me.

      • Serge February 25, 2018 Leave a Reply

        Cleaning solution helps until I restart VS. So, I’ve investigated it with debugview and it appears projects not up to date because ‘/path/projectname.BSC’ was modified at 02/25/2018 15:01:43, which is newer than ‘/path/projectname.LIB’ which was modified at 02/25/2018 14:42:59. Digging right now.

  5. Gerry Suggitt November 20, 2018 Leave a Reply

    I have a solution with about 50 projects. 4 always get rebuilt each time I click “Build Solution”

    I have done all the usual stuff: identifying files that don’t exist; setting “Copy if Newer”, etc.

    I am using VS2015. I changed the config file as shown in file C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe.config, restarted VS and clicked “Build Solution” but all I got in DebugView was a few lines of the ilk:
    [33764] VSMSOUI: Button ‘&Rebuild Solution’ ({5EFC7975-14BC-11CF-9B2B-00AA00573819}:883) defined by package ‘(null)’ ({D309F791-903F-11D0-9EFC-00A0C911004F}) uses icon guidOfficeIcon:746, which is no longer supported

    There is absolutely nothing that looks like build diagnostics.

    Setting by Build Verbosity to “Detailed” I get lots of output but nothing like “not up to date”. Instead I get stuff like:

    ------ Build started: Project: UpdateServer, Configuration: Debug Any CPU ------
    Build started 2018-11-20 10:42:44 AM.
    Building with tools version "14.0".
    Target "_CheckForInvalidConfigurationAndPlatform" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\IMS\src\Google.Server\src\WoofPACS\UpdateServer\UpdateServer.csproj" (entry point):
    Task "Error" skipped, due to false condition; ( '$(_InvalidConfigurationError)' == 'true' ) was evaluated as ( '' == 'true' ).
    Task "Warning" skipped, due to false condition; ( '$(_InvalidConfigurationWarning)' == 'true' ) was evaluated as ( '' == 'true' ).
    Using "Message" task from assembly "Microsoft.Build.Tasks.Core, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    Task "Message"
    Done executing task "Message".
    Task "Message"
    Done executing task "Message".
    Task "Error" skipped, due to false condition; ('$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')) was evaluated as ('bin\' != '' and !HasTrailingSlash('bin\')).
    Task "Error" skipped, due to false condition; ('$(BaseIntermediateOutputPath)' != '' and !HasTrailingSlash('$(BaseIntermediateOutputPath)')) was evaluated as ('obj\' != '' and !HasTrailingSlash('obj\')).
    Task "Error" skipped, due to false condition; ('$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)')) was evaluated as ('obj\Debug\' != '' and !HasTrailingSlash('obj\Debug\')).
    Done building target "_CheckForInvalidConfigurationAndPlatform" in project "UpdateServer.csproj".

  6. Kent November 26, 2018 Leave a Reply

    Hi Gerry,

    Were you able to solve it?

    There isn’t much to go on here. It may look like guidOfficeIcon is not supported any more. It’s difficult to do diagnostics with this little information.

    Do you know what project triggers the build every time?

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>