MSBuild 3.5 difference

05/26/08

MSBuild 3.5 difference

First, some background. For Continuous Integration, we’ve been using NAnt to exec MSBuild for awhile. To discover our NUnit tests, I set the build script up to exec MSBuild on each .sln file with the MSBuildEmitSolution environment variable set to 1 (on a short task - ValidateSolutionConfiguration). This converts the solution file to MSBuild XML. Immediately after that, I parse the emitted .proj file to find projects in a Tests solution folder. This seemed easier and safer than trying to parse the proprietary .sln file format. We’re specifying which tests to run in the solutions to make the build very easy for developers to maintain.

The problem started when we began moving projects to VS 2008. Sometimes MSBuild 3.5 would not generate the .proj file. This did not occur consistently. It did seem to generate a .cache file, though, which led me to this article:

http://blogs.msdn.com/msbuild/archive/2008/02/11/what-s-up-with-xxx-sln-cache.aspx

Setting MSBuildUseNoSolutionCache to 1 along with MSBuildEmitSolution seems to have resolved the issue.

The article makes it sound like this is not a good feature to rely on. We may have to come up with a different scheme in the future.


Your Host: webmaster@truewill.net
Copyright © 2000-2013 by William Sorensen. All rights reserved.