Cruise Control.NET and VS 2008 web projects

I ran into a few problems getting CC.NET to build a project after migrating it to Visual Studio 2008.  These were primarily MSBuild related, so if you're using NAnt or something I can't help you.

The first thing I did was change the MSBuild executable location in the project configuration block of ccnet.config.  I was hoping this was all I had to do, but no such luck:

<executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>

At that point, my build blew up with these errors:

C:\CCnet\offcuff\WorkingSource\web\web.csproj (196,11): errorMSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. C:\CCnet\offcuff\WorkingSource\web\web.csproj (196,11): errorMSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

I remember having a similar problem when I first starting using Web Application Projects (as opposed to the heinous VS Web Sites) with Cruise Control.NET.  This error was easy enough to solve, I simply copied all of C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0 to my CC.NET server.

Unfortunately, I still couldn't get the thing to build with MSBuild.  It appeared to be building the projects out of order and threw errors about various dependant projects not being available.  At that point, I threw my hands up and just started trying things.  I figured installing VS 2008 on the build server would fix it, but I didn't really feel like doing that.  Instead, I took a shot in the dark and installed VC# Express 2008 and Visual Web Developer Express on the machine, which proved to be the trick.

So if you're having problems with MSBuild on a build server, just install the VS Express editions.

Comments (2)

  1. si wrote::

    Same problem. Using the v9.0 web application target fixed it for me.

    Monday, May 5, 2008 at 2:37 am #
  2. Decker97 wrote::

    You can also install the Visual Studio 2008 SDK instead if you don’t want to install the express edtion.

    Monday, November 17, 2008 at 2:10 pm #