Visual Studio 2008 crashes if you have a high number of parallel builds

If you are facing a similar situation as titled please know that its a known issue with Visual Studio 2008 and its fixed in Visual Studio 2010. We can quantify high number of parallel builds as 4 or more. We just had a customer who was facing this crash for a long time and he used to workaround the crash by reducing parallel build count to three. The crash is not a regular crash but yeah happens quite frequently to freak you out, imagine you starting a daily build and then leave office. :(

So good news is that we have a reliable workaround for this issue, its bit of work, but yeah anything for speeding up the build process. :)

Cause:

Its been noted that parallel build fails/crashes if the build process ‘starts’ off by building several projects in parallel at the beginning. If we configure the build to build just one project at the start (by setting dependencies in such a way) then parallel builds work fine.

Resolution:

The way to do this is to create an EmptyProject…

 

Save it with a name, you can give it a more sensible name like All.vcproj. Please add it to the existing solution and set all your projects in the existing solution to be dependent on this empty project. After setting dependency this is how the build order should look like…

 

At the top is EmptyProject. The whole idea here is to prevent parallel build from launching at the beginning of a build. Once the first project is built then visual studio can proceed with parallel builds. So now if you build this project this is what we get...


 

Note that while the first project is being built no other project is being built in parallel since they are all dependent on the output from EmptyProject. Once this project completes parallel build starts, see second highlighted section in red.

This fixed the crash in my customer's case. Hope this helps you too.