Finally have Subversion + CruiseControl.NET + MSBuild running
I’ve been struggling the whole afternoon to get some kind of continuous integration up and running. It started with that I got sick and tired of the Publish feature in Visual Studio 2008 because it just starts to fail from time to time and it’s kind of impossible to find out why because it doesn’t give any kind of error information.
Anyway, I started to look at MSBuild and see if it could handle my Publish task and I found this great article. It explains how to make a build file that builds your project and then also simulates the publish feature and puts just the files necessary into a separate folder.
While I was on the subject I thought that I could as well see if I could set up my source control machine to build my app as soon as I check in some files, copy the build to a folder and make that folder a web application.
It actually was kind of easy. I found an article by Omar Al Zabir that explains this in great detail.
Not any problem at all?
Of course. The one I had the most problem with was the infamous Microsoft.WebApplication.targets bug. When you build your project on the build machine you get this error.
error MSB4019: The imported project “C:Program FilesMSBuildMicrosoftVisualStudiov9.0WebApplicationsMicrosoft.WebApplication.targets” was not found. Confirm that the path in the <Import> declaration is correct and that the file exists on disk.
I have had this problem before when we migrated a “Website” to a “Web application project” at my last job. What I remembered from it was that you had to copy the file Microsoft.WebApplication.targets from its location on your dev machine to the build machine. Well fine. The problem in my case was that the file already was there. I looked around for maybe an hour or until i realized that the path on my build machine was:
C:Program FilesMSBuildMicrosoftVisual Studiov9.0WebApplicationsMicrosoft.WebApplication.targets
While on my dev machine it was:
C:Program FilesMSBuildMicrosoftVisualStudiov9.0WebApplicationsMicrosoft.WebApplication.targets
Notice the difference? Don’t you just love Microsoft sometimes .. just copy the path and remove the space from “Visual Studio” and it works.
That was actually the only major problem I had. Otherwise, I used my brain and the articles I linked to and everything is a happy puppy.
Thanks and good night.