How to create a new project for the TFS Build Extensions
If you’ve been working with TFS 2010 build workflows you might have come across a community-developed set of custom activities on Codeplex called the Community TFS Build Extensions. This is a great add-on to the built-in activities but the documentation is still under development so starting to work with the activities can be a bit more work that necessary.
The steps below should help you get create a new .NET project for developing custom build templates with the TFSBE activities:
- Download and extract the latest Community TFS Build Extensions release.
- Create a new Workflow Activity Library.
- Make sure target framwork is set to .NET Framework 4
- Add a reference to System.Drawing
- Add references to Microsoft Team Foundation Server assemblies:
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.dll
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.Build.Client.dll
- C:\Windows\Microsoft.Net\assembly\GAC_MSIL\
Microsoft.TeamFoundation.Build.Workflow\v4.0_10.0.0.0__b03f5f7f11d50a3a\
Microsoft.TeamFoundation.Build.Workflow.dl - C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.TestImpact.BuildIntegration.dll
- C:\Windows\assembly\GAC_MSIL\Microsoft.TeamFoundation.TestImpact.Client
\10.0.0.0__b03f5f7f11d50a3a\Microsoft.TeamFoundation.TestImpact.Client.dll - C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.VersionControl.Client.dll
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.VersionControl.Common.dll
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.WorkItemTracking.Client.dll
- Add references to TFS Build Extension components.
- Make a copy of the default build template and add it to the project.
- The completed solution should look something like this:
- Open the template and add a new Tab to the Visual Studio Toolbox
- Select the new tab and choose to add new toolbox items
- Browse to the TFS Build Extension component you want to use and add the activities to the toolbox tab
- The new toolbox tab should list the selected activites:
- Now you are ready to extend the workflow by adding new TFS Build Extension activities to the template!
A sample project with the above references added can be downloaded here: TFSBE.Template.zip.