Freigeben über


Help! I’ve created a custom XAML workflow activity and now I don’t see the Team Foundation Build activities in the toolbox

One of the first things you’ll notice when you create a custom XAML workflow activity to use in Team Foundation Build is that all of the Team Foundation Build activities disappear from the toolbox. The reason for this is that when you’re editing a custom XAML workflow activity it doesn’t know that its part of a build workflow and that those activities should be shown. To have them appear you need to have at least one Team Foundation Build workflow activity in your custom XAML workflow activity, which leaves you in a chicken and egg situation.

To resolve this situation you’ll need to edit the XAML for the activity (you can open this instead of the designer by right-clicking the activity in Solution Explorer and choosing View Code) and hand add a Team Foundation Build workflow activity. There are two steps:

  1. Add the Microsoft.TeamFoundation.Build.Workflow.Activities namespace (xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") to the root Activity element.
  2. Add a Team Foundation Build activity as a child of the Activity element, I usually use the GetBuildDetail activity because it doesn’t have any required elements, and I enclose it in a Sequence so I can add other Team Foundation Build activities before removing the GetBuildDetail activity.

Here is a minimal activity that will show the Team Foundation Build activities in the toolbox:

<?xml version="1.0" encoding="utf-8"?>

<Activity mc:Ignorable="sap" x:Class="DevDiv.TeamBuild.Activities.ProvisionAgent"

          xmlns="https://schemas.microsoft.com/netfx/2009/xaml/activities"

          xmlns:mc="https://schemas.openxmlformats.org/markup-compatibility/2006"

          xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow"

          xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System"

          xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"

          xmlns:s="clr-namespace:System;assembly=mscorlib"

          xmlns:s1="clr-namespace:System;assembly=System"

          xmlns:s2="clr-namespace:System;assembly=System.Xml"

          xmlns:s3="clr-namespace:System;assembly=System.Core"

          xmlns:s4="clr-namespace:System;assembly=System.ServiceModel"

          xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities"

          xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities"

          xmlns:sap="https://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"

          xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"

          xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System"

          xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel"

          xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=System.Core"

          xmlns:sd="clr-namespace:System.Data;assembly=System.Data"

          xmlns:sl="clr-namespace:System.Linq;assembly=System.Core"

          xmlns:st="clr-namespace:System.Text;assembly=mscorlib"

          xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml">

  <Sequence>

    <mtbwa:GetBuildDetail DisplayName="Get the Build" />

  </Sequence>

</Activity>

Comments

  • Anonymous
    June 03, 2010
    Hi William, another approach to this problem is to add the TFS build activities manually to the toolbox, by browsing to the Microsoft.TeamFoundation.Build.Workflow.Activities assembly. Then it is possible to drag them from the toolbox into the activity, and the namespaces is created for you Cheers /Jakob