Why is my project building when marked up-to-date?

Viewed 29

I'm working on optimizing my build process. When I go to build my solution, it's always rebuilding a few projects - namely one named ManagedToNativeInterface.

Taking information from other questions, I enabled Diagnostic level build information.

This project is showing as up-to-date

Why is this project still being build? It's worth noting that we do have other processes in our solution that always run (be design).

Project that shouldn't build but is getting built:

> 22>------ Up-To-Date check: Project: VisualStudio\ManagedToNativeInterface\ManagedToNativeInterface.vcxproj, Configuration: Release x64 ------
22>All outputs are up-to-date.
22>Time Elapsed 0 ms
22>------ Build started: Project: ManagedToNativeInterface, Configuration: Release x64 ------
22>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild;$(MSBuildProgramFiles32)\MSBuild
22>Trying to import C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\$(MSBuildToolsVersion)\Microsoft.Common.props using extensions path C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild
22>Property reassignment: $(TagMajorVersion)="" (previous value: "6") at P:\standard\TagVersion.props (19,3)
...
1 Answers

In the past, I faced this exact situation. It's very frustrating wondering why the project insists on rebuilding even though I have not touched any code since the last compile and run.

The usual culprit in my experience is that a header file was deleted or renamed but it was not removed from the Project under the header file list. So, the compiler thinks that it is a generated file and insists on re-running the compile in hopes that the file will be created in a pre-build step or some other process. So, visually look through the .h and .cpp file list in Solution Explorer and make sure all of the files are current and exist on disk.

Related