OdeToCode IC Logo

MSBuild and Web Application Projects

Wednesday, May 31, 2006

One of the benefits of moving to .NET 2.0 is having a clean build computer. A build computer is a machine where software can compile in an isolated environment, and away from the quirkiness of a machine in day-to-day use. The goal is to produce repeatable builds for test and production with no manual steps and a minimum amount of overhead. Since the .NET framework 2.0 installation includes MSBuild.exe (which can parse project and solution files, compile source code, and produce binaries), there is no need to install Visual Studio on a build machine.

Web Application Projects throw in a twist because they import a .targets file: Microsoft.WebApplication.targets. The Web Application Projects installation will copy this file to a machine, but I was hesitant to run the install on a build computer. The install assumes Visual Studio will be on the computer, because it asks to download a VS specific update.

The good news is that copying Microsoft.WebApplication.targets to the build computer works. The file lives in the Microsoft\v8.0\WebApplications sub directory of the MSBuild extensions path (typically “c:\Program Files\MSBuild”).

P.S. Yes, I know about Team Foundation Build, but the build scripts and framework I’ve been using for 5 years work so well, so I’m not compelled to switch.

Sriram Thursday, July 6, 2006

I am curious to know what are the guidelines/steps you went through for this building process and how did you manage your environment in terms of getting the latest files from VSS etc. Would appreciate if you can post a detailed article when your time permits.

Thanks in advance
Scott Thursday, July 6, 2006
Sriran: I've thought about it many times. I started it all before Cruisecontrol and NANT came into fashion (which was even before MSBuild, etc), so I've been feeling obsolete. I might try to upgrade to newer tools first.
Scotty Wakefield Tuesday, October 24, 2006
Hi Scotty,

Just in case people are wanting to use Team Foundation Build, you still have to copy the .targets file anyway. So thanks for the info, it helped me get the Web App Project working on our Team Foundation Build Server.

Joannes Vermorel Friday, December 15, 2006
Thanks for the tip. I am amazed that 6 months later, such a twist is still not fixed in the VS 2005 SP1 that has just been released.
Comments are closed.