Once in a while you will stumble upon the truth but most of us manage to pick ourselves up and hurry along as if nothing had happened. – Winston Churchill

Deployment

When looking at Visual Studio Lab Management and how deployment are done I found this diagram.

If you look at the Virtual Machine 1 box inside the Hype-V Host box you find Build Agent. This is the same as Build Agent A.1 used on the Build Machine for doing “normal” builds as shown in this diagram.

This means that you can use the the TFS Build Agent to do continuous/automated deployment even if you don’t have the Lab Management parts.

How to set it up

To make it work you could set it up something like in the diagram below.

On the Team Foundation Application-Tier the build controller will delegate the different parts of the build and deployment to the different build agents based on the assigned tags passed to build for the different parts. This can be done by adding process parameters as described at the end of Jim Lambs post on How to Create a Custom Workflow Activity for TFS Build 2010 RTM

You have to modify your build workflow to do the deployment. To do this you add a AgentScope activity for every server you want to deploy to. In the AgentScope you add what ever workflow activity you need to perform the deployment. Below is a very simple example.

In ths post I will show how to build ClickOnce applications with TeamBuild for multiple environmentsin Team Foundation Server.

I have been trying to build ClickOnce applications in our TeamBuild for some time now and only after long ours of googling and trial and error was I successful. The most useful information I found on this blog: