Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want to specify assemblies that contain custom code activities you've written you need to do the following:</p> <ol> <li>Build you custom activities into your workflow. </li> <li>Make sure your xmlns at the top is defined correctly: xmlns:local="clr-namespace:BuildTasks;assembly=BuildTasks"</li> <li>Make sure the tags in the XAML for the build process have the local (or whatever prefix you've used) correctly.</li> <li>Check in your updated workflow XAML into your team project and update your build definitions.</li> <li>Create a new directory in your team project called "CustomBuildAssemblies"</li> <li>Go to the bin/Debug (or release) folder of the project that you used to create the custom build tasks (basically get the dll that you're putting in the GAC) and place it into the directory created in step 5.</li> <li>Tell the build controller where to look for the custom assemblies by going to Team Exporer, selecting the project you're doing this for, expand the project list out and right click on "Builds", and select "Manage Build Controllers". Sellect the controller (should be the first thing in the list) and click properties. Set the version control path to the directory that was created in step 5 (located in the middle of the popup).</li> </ol> <p>At this point you have a custom XAML workflow that is referencing (importing) a custom assembly (or multiple ones) that have been included into source control. The build controller now knows where these custom assemblies are located. This allows you to "check in" new versions of those custom assemblies if you ever need to add/update your custom build tasks.</p> <p>Hopefully this will help you out. It took me some time to figure this out as well. Let me know if I need to make this any more detailed. I wish I could post some screenshots of the dialogs.</p> <p>UPDATE: I completely forgot about this thread till I saw that it was revived. I can also update this answer as I've found a very good way of making TFS pull the latest version of your custom build task assembly: Making a unique version number for the assembly.</p> <p>I use a T4 template and run it before I build the assembly. It updates AssemblyInfo.cs after reading the checked-in custom activity DLL.</p> <pre><code>&lt;#@ template debug="false" hostspecific="true" language="C#" #&gt; &lt;#@ assembly name="System.Core" #&gt; &lt;#@ assembly name="System.Xml.dll" #&gt; &lt;#@ import namespace="System.Xml" #&gt; &lt;#@ import namespace="System.Linq" #&gt; &lt;#@ import namespace="System.Text" #&gt; &lt;#@ import namespace="System.Collections.Generic" #&gt; &lt;#@ import namespace="System.IO" #&gt; &lt;#@ import namespace="System.Reflection" #&gt; &lt;#@ output extension=".cs" #&gt; &lt;# //relative path to the DLL for your custom assembly in source control var filename = this.Host.ResolvePath("..\\..\\..\\..\\BuildAssemblies\\BuildTasks.dll"); Version buildInfoAssemblyVersion = AssemblyName.GetAssemblyName(filename).Version; // Setup the version information. Using the DateTime object make it kinda unique var version = new Version(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, buildInfoAssemblyVersion.Revision + 1); #&gt; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows.Markup; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("BuildTasks")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("BuildTasks")] [assembly: AssemblyCopyright("Copyright © Microsoft 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("feab7e26-0830-4e8f-84c1-774268727cbd")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] // Version information is a combination of DateTime.Now and an incremented revision number coming from the file: // &lt;#= filename #&gt; [assembly: AssemblyVersion("&lt;#= version.ToString() #&gt;")] [assembly: AssemblyFileVersion("&lt;#= version.ToString() #&gt;")] [assembly: XmlnsDefinition("http://localhost/BuildTasks/Activities", "BuildTasks.Activities")] [assembly: XmlnsDefinition("http://localhost/BuildTasks/Activities/InstallerA", "BuildTasks.Activities.InstallerA")] [assembly: XmlnsDefinition("http://localhost/BuildTasks/Activities/InstallerB", "BuildTasks.Activities.InstallerB")] [assembly: XmlnsDefinition("http://localhost/BuildTasks/Activities/CodeAnalysis", "BuildTasks.Activities.CodeAnalysis")] [assembly: XmlnsDefinition("http://localhost/BuildTasks/Activities/Standards", "BuildTasks.Activities.Standards")] [assembly: XmlnsDefinition("http://localhost/BuildTasks/Activities/CI", "BuildTasks.Activities.CI")] [assembly: XmlnsDefinition("http://localhost/BuildTasks/Activities/Version", "BuildTasks.Activities.Version")] </code></pre> <p>You'll notice at the bottom I also setup XML namespace definitions for each of the namespaces that I use in the workflow. I've found that the generated XMAL looks much cleaner and it's also helped with my issues.</p> <p>I created this file as AssemblyInfo.tt and just make sure I run it (right click and select run T4 or something like that) before building the assembly.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload