Visual Studio (2012, 2015) rebuilds project although nothing has changed
msbuild, visual-studio, visual-studio-2012, visual-studio-2015
Solution
OK, I finally could resolve this myself. I apparently overlooked one dependency that was not set as project dependency. This is necessary since not all projects in the solution are linked through project references but through ordinary binary references (since a subset of projects can also be opened in a partial solution where most of the development takes place, for faster loading etc.).
Problem
I have a fairly large solution (approx. 50 projects, all C#) that I am building in VS 2012 (update 4). I noticed that after having done a complete rebuild from within VS, directly followed by a build (hitting F6) causes one project to rebuild, although I haven't touched anything. A second invocation of build correctly detects that all projects are up to date. Setting msbuild output to diagnostic and examining the output of the first build invocation shows this: ``` NuGet package restore started. Restoring NuGet packages for solution XXX. [... some boring lines on NuGet Package restore] All packages are already installed and there is nothing to restore. NuGet package restore finished. Project 'YYY' is not up to date. Last build was with unsaved files. ------ Build started: Project: YYY, Configuration: Debug Any CPU ------ Build started 21-11-2013 21:20:54. ``` I am particularly intrigued by the message that `Project 'YYY' is not up to date. Last build was with unsaved files.` I have no unsaved files. Interestingly, both Google and Bing do not give a single hit when searching for this message. Any clues on what could cause this? How could I debug this part of the build process? I believe that this part of the build process is even before the invocation of MsBuild (at least the new NuGet Package Restore functionality comes before MsBuild is invoked, I believe MsBuild kicks in from the 'Build started' line.