Wednesday, September 7, 2011

Automatic deploy multiple websites in a solution using TFS Continious build

On the internet are a lot of resources to be found to automatically deploy websites to your (development) webserver. Here's how I solved that problem:

First of all, make sure your Team Foundation Server Continious build is up and running, and building packages the way you configured is.
Second of all, make sure you can deploy your website using the single click publish using MsDeploy.
Now edit the project file of the project(s) you would like to deploy and add the following tags in the PropertyGroup element:
In the PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " element add the application path. By doing this, we can deploy different configuration types to app paths. If you need for example also a different username and password, you can add them in this section too.
Once we've edited the projects as mentioned above, we can setup the Build:

Voila! You're finished! Now build and watch your site change!

Save the build configuration and start a new build. If everything is correct, the website will be deployed on each build! For references you can look at the site of Vishal Joshi:

and stack overflow:

1 comment:

  1. Note to self to preserve the files on the server: true
    as found in