If your VS2010 C++ build is constantly rebuilding a project that hasn’t changed…

Check if you’re seeing the following output in the build pane:


InitializeBuildStatus:
  Creating ".unsuccessfulbuild" because "AlwaysCreate" was specified.

I’ve just fixed a bunch of these errors in one of our solutions here and all of these were caused by one of two issues:

  • The project file referenced files that were no present in the source tree
  • A custom build step either was supposed to generate a file but didn’t, or the file ended up in the wrong place

In order to find out if there are missing files that trigger the perma-rebuild, you’ll also have to enable Visual Studio’s debug output as described in this stackoverflow answer.

On combining #import and /MP in C++ builds with VS2010

I’m currently busy porting a large native C++ project from VS2008 to VS2010 and one of the issues I keep running into was build times. The VS2008 build uses a distributed build system; Unfortunately the vendor doesn’t support VS2010 yet, so I couldn’t use the same infrastructure. In order to get a decent build speed, I started exploring MSBuild’s ability to build projects in parallel (which is fairly similar to VS2008’s ability to build projects in parallel) and the C++ compiler’s ability to make use of multiple processors/cores, aka the /MP switch.

Read More