This project is read-only.

Guide to Include TFS Build Extension in Build Process Template

Mar 28, 2011 at 8:50 PM
Edited Mar 28, 2011 at 8:55 PM

Can i get some steps on how to include TFS Build Extension dll in Build process template.

 

 

Mar 28, 2011 at 10:06 PM

This is what we are doing:

THE CUSTOM ACTIVITY
1. I created a new project and referenced the activities. 
2. Copy the DefaultTemplate.xaml file, rename to CustomTemplate.xaml and place it in the root of your project (Include it in your project)
3. Build solution
4. Now you can drag anything you want from the activities toolbox into your workflow.
5. Copy the template to the BuildProcessTemplates (and check in) and place the dlls to a Custom Activities folder (or bin folder if you want)

* The way I setup my project was to copy the xaml file to the output folder, then the dll's that are output from the TFS Build Extension get copied to a 'Custom Activities' folder underneath that (you'll see why below)

THE SERVER
1. In TFS Explorer go to 'Manage Build Controllers' by right clicking the Builds item in one of your projects
2. Select your build controller (you will need to do this for each controller) and click 'Properties...' over the right hand side. 
3. One of the items is 'Version control path to custom assemblies' click the ellipses '...' next to the textbox and browse to the path where your Build Extensions are. We use a Custom Actvities folder underneath our BuildProcessTemplates folder as I detailed above

* If the dlls are referenced appropriately, you shouldn't need the CustomTemplate.xaml or the project, but it helps for doing a sanity check.

Good luck.

Ben

Mar 28, 2011 at 10:28 PM

Stay tuned!  There is a lot of documentation that will be available soon:  http://mikefourie.wordpress.com/2010/10/24/rangers-team-build-customization-guide/

Mar 30, 2011 at 7:29 AM

This is useful. However any detailed write up for the first time users would be wonderful.

Meaning, extending & modifying the existing workflow is not that complex. We just branch it out, add our own stuff (mostly using MSBuild activity) and go on..

With MS added more complexity to the build world by introducing WWF in 2010.. better guidance to reuse these kinda custom activities would be very useful.

Now, in a new solution, add the tfsbuildextensions activities are referenced. When I rename & add existing defaulttemplate, seeing tons of compilation issues. Asking me to reference other 100 TeamFoundation assemblies..not sure whether this is the right path..

Please post some write up on reusing tfsbuildextensions.

Thanks in adcance.

 

Mar 30, 2011 at 1:06 PM

No problem.  The write-up is coming... it's in its final stages of the Visual Studio ALM Rangers project.

The experience isn't as great as we had hoped because of the platform changes in TFS 2010 Build.  We got some great improvements with WF but now we also have some painful areas (like when using other third-party custom activities).  It happens...

 

You can also take a look at both of the two books that have a good reference for how to use custom activities in a build process template.

  • Professional Team Foundation Server 2010, Wrox:  The method used does not require you to have to have a ton of references to all of the Microsoft TFS assemblies.  I would recommend this one if you are not worried about successful compilation of your.  Start on Page 404 in Chapter 16 and import the source code from the CodePlex project...
  • Inside the Microsoft Build Engine: Using MSBuild and Team Foundation Build, Microsoft Press:  The method used by this author does go ahead and setup the build process template to be "compiled" to check to make sure the XAML is good.  You will have to add the references necessary and the author goes through how to do each one.
Mar 31, 2011 at 12:07 AM

Thanks, this discussion has given me some direction to move forward.

Apr 26, 2011 at 2:55 PM

I've followed the instructions outlined by bsparkinson to include the TFS Build Extensions into my custom build workflow but I cannot for the life of me get the activities to show up in the toolbox.  

These are the steps I've done.

Can anyone think of what I'm missing here?

May 30, 2011 at 12:32 PM

Hi

Sounds about right. Did you get it working?

Mike

May 30, 2011 at 4:37 PM

No, I have not.  I've moved on to other work items, but eventually I'm going to have to figure this one out.  Fortunately, this is not a pressing need as of yet.

Jun 3, 2011 at 6:31 PM

I have tried to add a reference to Microsoft.TeamFoundation.Client.dll but after I click OK it is not there.

Any ideas?

Jun 4, 2011 at 8:28 AM

Are you adding the reference to a Class Library? Check the project properties so that the target framework is set to .NET Framework 4 and not .NET Framework 4 Client Profile.

Jun 7, 2011 at 1:29 PM

it is working.  not sure what I did.  maybe I misread the list of references...

now what do I do?  I do not see anything new on the toolbar.  how do I access the TFS Build Extensions in my XAML designer?

Jun 10, 2011 at 9:24 PM

I tried a bunch of different setups, and like MegaBite, I can't seem to get the TFS Build Extensions in my toolbox. There has to be something more to it than just adding the references to the project, right? I can make my own custom controls like the "DoExcitingThings" example from the first link in dlargen's post above, so I assume I could also just compile the source code in my own project and it would work, but I don't really want to do that. What am I missing?

Jun 13, 2011 at 10:07 PM

I've put together a short how-to instruction to help you create a working project for building custom templates with the TFS BE activites: http://msmvps.com/blogs/molausson/archive/2011/06/13/how-to-create-a-new-project-for-the-tfs-build-extensions.aspx. There's also a sample project at the end of the post to help you get started quickly.

Jun 14, 2011 at 6:27 PM

Hey thanks. I appreciate the post. I finally got my project up and running.

There were a couple dll's mentioned in your post that were missing from the other examples I saw: Microsoft.TeamFoundation and Microsoft.TeamFoundation.VersionControl.Common. Prior to adding these references, my Visual Studio would crash when I would try to add new items to the toolbox by right clicking and selecting Choose Items. I could create my own custom code activities, which would automatically be added to the Toolbox without me having to use the right click menu. Post #2 in this thread makes it sound like you don't have to manually add the controls to the toolbox, so I thought just adding the references would do the trick similar to adding custom code activities.

At any rate, I appreciate the help, and I'm looking forward to using these extensions!

Jun 14, 2011 at 11:02 PM

If you compile the project in Visual Studio it will automatically add the controls to the toolbox for you. As yet I haven't had to manually add any toolbox items. If your projects aren't compiling because of missing dlls then you won't get the items added.

Jun 15, 2011 at 5:59 PM

Great to hear it solved your problem! Feel free to get back with your experience from using the activities.