Adjust the ReleaseTfvcTemplate.12.xaml build template to work with the BizTalk Deployment Framework

2 minute read

If you want to use the BizTalk Deployment framework in combination with Release Management you need to adjust the default build template that comes with Release Management.

If you did not find it already you can find the default build template in the installation folder of release management.

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\Client\bin\ReleaseTfvcTemplate.12.xaml

Copy this template to TFS and open it to make a small adjustment. In the workflow explorer Navigate to the following sequence component:

“Overall Build Process” – “Run on Agent” – “Try” – “Compile, Test and Publish”.

Whit this component selected, select “Variable” in the lower left corner.

image

In the popup window create a new “Variable” by clicking “Create Variable” and call it “BinariesDirectory” and make it of the type “String”.

image

This variable will be used to save the directory in which the Deployment Framework components can be found.

Next step is to add a “GetEnviromentVariable<T>” action just above the “Run MSBuild” action. Select the type “String” and call the action “Get Binaries Directory”.

To get the Binaries Directory we want to make use of a WellKnownEnvironmentVariable (MSDN). To use such a variable you need to import a assembly reference. You can add a assembly reference by clicking on “Import” next to “Arguments” in the footer of the workflow screen.

image

Import the “Microsoft.TeamFoundation.Build.Activities.Extensions” namespace to make use of the WellKnownEnvironmentVariables. Know you can set the properties of the “Get Binaries Directory” action to get the “WellKnownEnvironmentVariables.BinariesDirectory” environment variable.

image

With this value we can change the MSBuild argument to build the MSI from the BizTalk Deployment Framework. Select the “Run MSBuild” action and adjust the “CommandLineArguments” property to the following value.

String.Format("/p:SkipInvalidConfigurations=true;TeamBuildOutDir=""{0}"" {1}", BinariesDirectory, AdvancedBuildSettings.GetValue(Of String)("MSBuildArguments", String.Empty))

Save and Check In the build template. If you use this build template to define a build definition you are able to use a Release within Release Management that uses the output of this build.

One thing to keep in mind that you will have to set the following properties on your build definition:

  • MSBuild platform: X86
  • Output location: AsConfigured

image