Home > Biztalk, Biztalk 2010, Biztalk Deployment Framework, Team Build, TFS, TFS2010 > Build Biztalk Deployment Framework Projects using TFS2010

Build Biztalk Deployment Framework Projects using TFS2010

The Biztalk Deployment Framework (BTDF) is a utility to help Biztalk administrators to easily output the Biztalk application, its components, configuration, and port bindings to an MSI package. Building Biztalk and BTDF projects can be automated using TFS Team Build because those projects are built using MSBuild. In TFS 2010, Microsoft changed the team build template from MSBuild configuration file to Workflow (WF4) activity. I have seen many posts asking how to use TFS Team Build to build BTDF projects but yet no one blogged about it. In this post, I will be modifying the default TFS2010 Team Build Template to support building BTDF msi packages.

Creating new Team Build Definition

  • Right click on one of the Teambuild definitions
  • Click New Build Definition

  • Enter the name of the build definition

  • Fill the Trigger, workspace and build default sections
  • Click on Process on the left
  • Click on Show Details
  • Click the New button
  • Click browse next to “Select the file to copy”
  • Select the Default Template, you can select the template you want to modify

  • Give it a name; I am naming it BTDFBuildProcessTemplate
  • Click Ok
  • In the Required group, click the ellipsis next to Items to Build
  • Add the solution you need to build which contains your Biztalk project(s)
  • Add the BTDF project you need to build, make sure that you switch the Items of type to *.*proj

  • Make sure that the solution is built first then the BTDFProj
  • Click the Configurations tab
  • My solution contains X86 and Any CPU projects, therefore I am choosing “Mixed Platforms”

  • Click OK
  • For this post, I am not running unit tests. Thus, I cleared the Automated Tests property
  • Change the MSBuild Platform to X86, otherwise Biztalk projects will fail

  • Save the build definition
  • Close the Team Build Definition.
  • Open Source Control from Team Explorer
  • Browse to the BuildProcessTemplates folder
  • Get latest version of the template we just created

Changes to the Default Template to Build Deployment Framework Projects

In this section, we will be modifying the workflow template we created in the previous section. Team build is different than building the solution from the visual studio. Team build creates two folders: one for the source files and one for the output called binaries. .btdfproj references biztalk dlls using a relative path which will be invalid when building the btdfproj using team build. We have two options, either to maintain the project structure and output the binaries to the source folder or add a condition to the .btdfproj to get the file from a different location when using Team Build. In this post, I will output the files into the bin folder in the source folder. This approach will affect your unit tests if you are running unit tests as team build checks the dlls in the binaries folder. It also affects copying the binaries to the drop folder. Another modification needs to be done to get this working. I will write another post to do such adjustment. The following steps adds activities to build the solutions and BTDF projects. The binaries of the projects will be output into the bin folder of each project in the source folder

  • Open the BTDFBuildProcessTemplate.xaml workflow xaml file created in the previous section
  • Click Collapse All

  • Expand On Agent

  • Expand the follow activities:
    • Try Compile, Test, and Associate Changesets and Work Items
    • Sequence
    • Compile, Test, and Associate Changesets and Work Items
    • Try Compile and Test
    • Compile and Test
    • For Each Configuration in BuildSettings.PlatformConfigurations
    • Compile and Test for Configuration
    • If BuildSettings.HasProjectsToBuild
    • For Each Project in BuildSettings.ProjectsToBuild
    • Try to Compile the Project
    • Compile the Project
  • Add a condition to check the type of the project to build by added an If activity between “Convert Server patch to Local” and “Run MSBuild for Project”

  • Drag and drop the “Run MSBuild for Project” to the Else section

  • In the If condition, check if the project extension is .btdfproj by entering the following condition:


  • Change the OutDir property to “” to output the binaries into the bin folder in the source directory. Thanks to Ajith  
  • Change the Display name of the if activity to something meaningful

  • If the project is a biztalk deployment framework project (*.btdfproj),
    • Add a new MSBuild activity to the If body, and rename it to Build BTDF Msi’s

    • Run msbuild (Build BTDF Msi’s activity) with the following arguments; we have set OutDir to “” to output the binaries into the source folder directory instead of the binaries folder.

  • Save the workflow and close it
  • Go to Source Control àBuildProcessTemplates
  • Checkin the workflow that was modified

  • Queue a new build
  • After the build is done, you will find the projects’ executables and BTDF msi in the bin folder of each project
  1. Larry Bargers
    February 23, 2011 at 10:55 am


    You replied to my post on TFS Forums about automating an obfuscated build. I’ve modified the default process templete to include my .saproj file to build. I get the following error when I attempt to run the automated build:

    C:\Builds\39\Manitou\DBManager\Sources\Releases\1.6.0\Fixes_1.6.0\DBManager\RepSwitch\DBManager.saproj (1): The element is unrecognized, or not supported in this context.

    Any idea on what I need to add to get this working?

    • Lajak Technologies Inc
      February 23, 2011 at 11:19 am

      Have you added an if statement to the templete to check if it is .saproj to run Invoke process activity with C:\Program Files\Red Gate\SmartAssembly 5\smartassembly.com” /build BinariesDirectory localProject /markasreleased ?

      Make sure you duplicate the template.

  2. Larry Bargers
    February 23, 2011 at 1:37 pm

    I setup the InvokeProcess in the “Then” statment of the “If”. Do I simply put “C:\Program Files\Red Gate\SmartAssembly 5\smartassembly.com” /build BinariesDirectory localProject /markasreleased

    in the Arguments of the InvokeProcess?


    • Lajak Technologies Inc
      February 23, 2011 at 1:47 pm

      I am not really familiar with smartassembly.com command arguments. You actually don’t need the Binaries directories, replace “$(ProjectDir)DBManager.saproj” with localproject. localproject is a variable that contains a reference to the project you added in the list under the process page in build definition. Is there an argument to set the output folder on the smartassembly.com? If yes, you need to set the output to be the BinariesDirctory

  3. Larry Bargers
    February 23, 2011 at 2:20 pm

    I’ve done as you have advised.

    My arguments are: “/build BinariesDirectory localProject /markasreleased”

    Filename is: “C:\Program Files\Red Gate\SmartAssembly 5\smartassembly.com”

    When I now try to fire up the project it builds successfully, but I get the following warning:

    TF270003: Failed to copy. Ensure the source directory C:\Builds\39\Manitou\DBManager\Binaries exists and that you have the appropriate permissions.

    The binaries directory is completely missing now, and it appears that the .saproj was not executed. Any ideas on why that may be?

    • Lajak Technologies Inc
      February 23, 2011 at 2:28 pm

      In your team build definition, How many projects do you have there? Do you only have the saproj file? Try removing the BinariesDirectory from the arguments.

      Is there anyway to set the output directory of smatAssembly.com?

  4. Larry Bargers
    February 23, 2011 at 3:35 pm

    There is an “Output” parameter I can use to set smartassembly output. I’ve added into the parameters but it is still not building the Obfuscated.exe.

    • Lajak Technologies Inc
      February 23, 2011 at 4:06 pm

      I will have to get back to you on this tonight or tomorrow morning. I will install the trial version and get familiar with the tool then test it with team build. Cheers.

    • Lajak Technologies Inc
      February 23, 2011 at 10:38 pm

      Hi Larry,
      I installed the tool. You don’t need to modify the workfolow. You need to edit the project file.
      Right Click on the project –> Unload project
      Right click on the project–> Edit project

      If you are using VB, after the following line:

      <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />


        <UsingTask TaskName="SmartAssembly.MSBuild.Tasks.Build" AssemblyName="SmartAssembly.MSBuild.Tasks, Version=, Culture=neutral, PublicKeyToken=7f465a1c156d4d57" />
        <Target Name="BeforeBuild" Condition=" '$(Configuration)' == 'Release' ">
          <CreateProperty Value="true">
            <Output TaskParameter="Value" PropertyName="RunSmartAssembly"/>
        <Target Name="AfterBuild" Condition=" '$(RunSmartAssembly)' != '' ">
           <SmartAssembly.MSBuild.Tasks.Build ProjectFile="SmartAssemblyPOC.saproj" 
  5. August 25, 2011 at 10:07 am


    Great post, however in the part where you specify the commandline parameters you will loose the ability to use additional MSBuild properties, i suggest to alter it to use:

    String.Format(“/p:SkipInvalidConfigurations=true /t:Installer {0}” , MSBuildArguments)

    see: http://biztalkdeployment.codeplex.com/discussions/226299

    • Lajak Technologies Inc
      August 25, 2011 at 3:30 pm

      I agree with you. It is implemented as you said except the screen shot is outdated. I didn’t have access to the same server when I wrote the article.

      Good catch and others can benefit form your comment.


  6. Jason
    September 14, 2011 at 2:44 am

    I have setup my solution to mirror yours but when it is running on the TFS build server it tries to see if the application is installed already. Is there any way for only the MSI to be created on the build server without it looking to see if it is installed already?


    • Lajak Technologies Inc
      September 21, 2011 at 3:07 pm

      Sorry for the delay. Is it still an issue? t is been a while since I worked on this. I will get back to you

  7. srs
    October 24, 2011 at 4:50 pm

    I have applied all the steps specified here ..and the tfs build completes successfully but when I go to the drop folder I dont see anything other than logs folder. Where should i look for the msi?

    • Lajak Technologies Inc
      October 27, 2011 at 11:16 pm

      It should be in the binaries folder and the drop folder.

  8. November 22, 2012 at 4:39 am

    BizTalk literally slows down the rate at which it processes messages.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: