Friday, May 27, 2011

Anyone actually using Workflow for builds in Team Build 2010

I have been using TFS 2010 since the early releases and I am very impressed with its features, some of which I have blogged about here:

But whenever I have tried using the new Team Build 2010 Build Template Workflow (which is based on MSBuild under the covers) I find it more difficult to navigate and manage. Not to mention there are not many activities around for things like, running StyleCop rules, creating IIS virtual directories, managing service accounts etc.

So the real question is, why would I use Workflow over pure MSBuild.

I am very impressed with the MSBuild Extension Pack that contains many tasks that covers the things I mentioned above and more. I also know there is a MSBuild activity which means you can make use of the MSBuild Extension Pack from within Workflow but this kind of defeats the purpose of using Workflow in the first place.

I also often want the ability to run a build locally before check-in. This build is normally a nightly build which not only compiles code, runs unit tests and acceptance tests etc but it sets up the environment. i.e. if you have a BizTalk solution and you need to deploy the bindings, schema's, maps etc the BTDF can be used to help facilitate this easily. Well when I say easily there is a bit of work to get this to work with Team Build that I will blog about soon...

I know in Team Build 2010 there is the new gated-check in feature that shelves changes, runs a build against the shelved changes then merges with the branch in question if successful. This is great but only half the story. On every get-latest I want the developers machine to be setup and be able to run the latest code. If another developer has added a WCF service with a new app pool or added a receive port, this script needs to take care of all that without each developer even thinking about it.

With the Workflow build templates, there is no way to run those builds locally. The gated-check in is an additional feature that addresses the problem of the developer not running a local build otherwise known as a "buddy build" before he/she checks in to prevent build failures.

To date, I use the "Upgrade Template" in Team Build 2010. I was wondering if anyone was actually using the Default Templates based on pure Workflow?


Kyndig said...

I have used them before on pure workflow at a previous job. I am currently setting one up at my current job but am required to create a few custom activities to support the current build process as I have to deal with VB6 projects and a very custom deployment setup. I like working with the Workflow process much more than the previous msbuild scripts because it is easier to configure, IMO, because you can visually see what is going to happen. Writing custom tasks/activities is about the same in either method.

Simon Hart said...


I found when I used Workflow for Team Build I found that I was editing the XAML code more than actually using the designer.

Regarding the point about activities, I agree I think writing activities is no different from writing custom tasks in MSBuild.

In the future when there is a larger community using Workflow for Team Build we will see many useful activities much like today with custom tasks and MSBuild.


John said...

We migrated to TFS 2010 a few months back and because we had old scripts written in MSBuild we stuck with it.

Perhaps in the future my company will consider migrating to Windows Workflow if there is a business case for it.

Simon Hart said...


It's the same for us where I work. Although I work as a consultant and work for different customers, what you said is true in all projects that I have encountered that require the use of TFS to manage their ALM process.

Although with Workflow you can still make use of MSBuild as I mentioned, but I don't see the benefit of this.