Archive for February, 2011

Team Build: Team Build Failed with “There was no endpoint listening at … ” Message

Yesterday I received the following error when I ran a manual team build

“There was no endpoint listening at … that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.”

I found out that the agents services were stopped. Started them and everything is back to normal. What stopped them? Not sure yet ūüėČ

You can check the team build agents by going to programs–>Microsoft Team Foundation Server 2010–>Team Foundation Server Administration console, click on build configuration

Categories: Team Build, TFS, TFS2010 Tags: , ,

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

Change the Username of the Teambuild to Domain User

Following these steps to change the Teambuild account service username from NT AUTHORITY\ NETWORK SERVICE to a specific username (e.g. domain\username):

Change the TFS Build Service username to the new username

  • Open TFS Administration Console
  • Click Build Configuration

  • Click Stop, to stop the service
  • Click Properties
  • Choose “This account” in Credentials groupbox
  • Enter username and password

  • Click Start to start the service

Change Build Agents Username Account

  • Repeat the steps from the previous section on the build machine
  • Make sure that the username is in the Team Build Service Accounts group
    • Click Team menu √†Team Project Settings √†Group Membership

  • ¬†
    • Check Show global groups
    • Select Project Collection Build Service Accounts
    • Click the Properties button

  • ¬†
    • Make sure that the new username is there

Team Build: Could not find file ‘Microsoft.BizTalk.TOM.resources’ when running Biztalk Unit tests

February 15, 2011 1 comment

I have set up Team Build to build a solution that contains Biztalk and C# projects. The environment I used was Biztalk 2010 and TFS 2010. When running the unit tests related to Biztalk Schemas or Pipelines I used to receive the following exception:

Could not find file ‘Microsoft.BizTalk.TOM.resources’

I know that I have a reference to the Microsoft.BizTalk.TOM.dll assembly in the Biztalk project and the unit test project. Unit tests were running on Visual studio 2010 but failing on team build.

I figure out that for some reason, Team Build decides not to copy the Microsoft.BizTalk.TOM.dll assembly to the binaries folder of that unit test project although I have the “copy local” property set to true. To force deploying the assembly to the unit test folder, make sure that you add it to the testsetting¬†deploy option.¬†Make sure that Biztalk server is installed on the Teambuild¬†machine and the path for the assembly is valid on the Teambuild¬†server. Otherwise you need to checkin the assembly into source control and reference the assembly in source control.¬†

  1. Open the testsettings file used for the team build definition
  2. Click Deployment from the list on the left
  3. Click Add Files


How to Find Build Service Account in TFS2010 and Visual Studio 2010

  • Open Visual Studio
  • Open Team Explorer
  • Right click on team project
  • Select Team Project Settings menu item
  • Select Group Membership menu item

  • On the Project Groups on [Team Project Name] dialog, check Show global groups
  • Click Defaultcollection\Project Collection Build Service Account
  • The User or Group list box, lists the build Service Accounts