ALM Rangers

How to create an adapter for the TFS Integration Platform - Part IV: IProvider

Submitted by Robert MacLean on Mon, 05/31/2010 - 09:10

Note: This post is part of a series and you can find the rest of the parts in the series index.

IProvider is the first class we will look at implementing for both adapters (WI and VC) as it provides the core information for the platform to talk to our adapter. The first thing you provider needs is the ProviderDescriptionAttribute, which has three properties ID, Name and Version.

[ProviderDescription("{7F3F91B2-758A-4B3C-BBA8-CE34AE1D48EE}", "SharePoint TIP Adapter - Version Control", "")]
The ID must be unique and you will need a record of it somewhere as it is used in configuration for the platform. The name and version are potentially used to make it easier for users, but I have not seen them used anywhere (maybe in future/different tools).

The only  method in the provider is the GetService method which is used to get the implementations of the interfaces/classes we will be building later. Put another way this allows the platform to request a class which implements a specific interface using this method:

object IServiceProvider.GetService(Type serviceType)
    TraceManager.TraceInformation("WSSVC:Adapter:GetService - {0}", serviceType);

    if (serviceType == typeof(IAnalysisProvider))
        if (analysisProvider == null)
            analysisProvider = new SharePointVCAnalysisProvider();
        return analysisProvider;
    if (serviceType == typeof(IMigrationProvider))
        if (migrationProvider == null)
            migrationProvider = new SharePointVCMigrationProvider();
        return migrationProvider;

    if (serviceType == typeof(IServerPathTranslationService))
        if (transalationProvider == null)
            transalationProvider = new SharePointVCAdapterTranslation();
        return transalationProvider;

    return null;

Above is the implementation is what I used in the SharePoint VC adapter, the WI adapter is the same except it does not have the server path translation service at the end.

Power Tip: Using Visual Studio 2010’s new “Generation from usage” features makes this stage of development much easier. 

How to create an adapter for the TFS Integration Platform - Part III: Overview of adapters

Submitted by Robert MacLean on Fri, 05/28/2010 - 10:42

Note: This post is part of a series and you can find the rest of the parts in the series index.

The TFS Integration Platform has two types of adapters, a WI (for work items, tasks,  bugs etc…) and a VC (version control) adapter and they are nothing more than a .NET assembly made up of a number of classes which, mostly, you will inherit from interfaces in the Toolkit project. For both adapters the key interfaces you need to implement are:

  • IProvider: Gives the platform the way to invoke your adapter.
  • IMigrationProvider: This is used for writing to the adapters source system, so for me SharePoint.
  • IMigrationItemSerializer: This provides support for converting the item to XML.
  • IAnalysisProvider: This is used for reading from the adapters source system.

as well as they both need to implement the ChangeActionHandlers abstract class.

The VC adapter also needs:

  • IServerPathTranslationService: Used to translate the path (i.e. directories and such) from other adapters to this adapter and visa versa.



While the WIT adapter needs:

  • IConflictHandler: Provides support for handling conflicts during the migration.


So in both adapters you will need a minimum of 6 classes you will implement, excluding any extra ones you will need for your specific requirements.

The core concepts of the adapters are all explained in the interfaces and so it appears that it is very simple to implement, and indeed it is – however there are some weird things which may catch you up which we will cover in detail in future posts.


Something very nice in the platform is the TraceManager class which is really just a wrapper around System.Diagnostics.Trace but it has some extras in that wrapper, such as being what is included in the console windows and log files. You will see this sprinkled through out my code because it is useful to to have when trying to debug later on.

Power Tip: The TraceManager puts all information written to it in the log files, so please make sure you do not put any sensitive information in there.

How to create an adapter for the TFS Integration Platform - Part II: Setup of the environment

Submitted by Robert MacLean on Wed, 05/26/2010 - 16:34

Note: This post is part of a series and you can find the rest of the parts in the series index.

Getting started with the adapter development is not the easiest task because you are stuck a little in the wild, so this part will serve as as a quick start guide for getting what you need to become a TFS Integration Platform developer.

SQL Server

The TFS Integration Platform requires Microsoft SQL Server so you need to install an instance of that.


It goes without saying, or maybe it doesn’t, that if you plan to write an adapter to integrate to TFS you will need TFS. Even if you don’t care about TFS, you will want to test and the TFS 2010 adapters are of the highest quality and so they make a great test target (so testing between your adapter and TFS). Thankfully with TFS 2010 you can now install on Windows 7 natively so this means as a developer you can have a great easy environment.

Target system (SharePoint for me)

Since I was developing for SharePoint that meant I needed a SharePoint installation, which meant a 20Gb Windows 7 Virtual Machine :( Hopefully for you this will be less of an issue.

TFS Integration Platform

The TFS Integration Platform, is a software component and database which runs on your machine and handles the actual moving of data around. You can get it from - however it may not be obvious which is the one you want since the team has so many download options, you want the tools:


During install you will get an option to install the service, which is recommended for production environments when you want to have the synchronisation running continuously. However for development this is not needed.

Power Tip: Once you have completed the tools install, go into to SQL Server and backup the TFSIntegrationPlatform database immediately. There are not only a few odd bugs that roam around the platform (it’s still in beta) which may cause you to need a restore of the database but if you want to test on a clean environment then a restore is quicker than a reinstall.

Platform Source

To build adapters you will also need the source code for the TFS Integration Platform which you can also get from CodePlex. Best is to get the latest drop of the code which you can get from the Source Control page and then by clicking on the Download link in the latest version box on the far right.


In there you will find the IntegrationPlatform folder which contains all the code from Microsoft.


Power Tip: Make a common root for the TFS code and yours (in my case I used RangersCode) and then create sub directories in there for platform and your code (so I had My Production and MS production folders under RangersCode). This helps keep the items close, which makes things easier later plus keeps them separate so you can identify them.

The code itself is for Visual Studio 2008, however you can be just like me and use Visual Studio 2010 and it will work just fine. Once you have done all of this you are finally ready for writing your adapter!

How to create an adapter for the TFS Integration Platform - Part I: Introduction

Submitted by Robert MacLean on Tue, 05/25/2010 - 14:29

Note: This post is part of a series and you can find the rest of the parts in the series index.

Since September 2009 I have been engaged in a ALM Rangers project, namely the TFS Integration Platform. Which is:

The TFS Integration Platform is a project developed by the Team Foundation Server (TFS) product group and the Visual Studio ALM Rangers to facilitate the development of tools that integrate TFS with other systems. Currently, the scope of this project is to enable TFS to integrate with other version control and work-item/bug tracking systems, but the eventual goal of this project is to enable integration with a broader range of tools/systems (i.e. build). This platform enables the development of two major classifications of tools: tools that move data unidirectionally into TFS, and tools that synchronize data bidirectionally.

So in short it is a integration system, like BizTalk or SSIS but specially built for version control and work items. I have not said TFS there because, it can work to migrate between other source control and work item systems provided adapters exist. Adapters are the logic which allows the TFS platform to connect to a variety of technologies, and my goal has been to build two of them – one for SharePoint lists and one for SharePoint document libraries.

You may have noticed that SharePoint isn’t a version control or work item system, so why integrate? Well lots of companies do use it for ALM related items, such as the lists being used for tracking work items and the document libraries are used to store content which should be in a source control system. This is the first post in a series which will give you an idea of what is involved in building adapters, show you what to avoid and hopefully give you a few laughs at my expense. 

Now I want to be clear this series will not covering usage of the platform or any of the core concepts in it. For those please see the links below in particular Willy-Peter’s blog. You do need to understand a bit about how the platform works before you attempt to build your own adapter.

As all my work was done for the ALM Rangers the source code for my adapters is included in the code which can be obtained from the CodePlex site.

To help you on your way let’s list a few links which are key for this:

Visual Studio ALM Ranger Champions for 2010!

Submitted by Robert MacLean on Fri, 05/14/2010 - 09:48

Group of Blue Men Tossing Another Into the Air Clipart Illustration I am a proud contributor to the Microsoft Visual Studio ALM Rangers (see this post for who they are) and each year, the Rangers have a vote for who they believe are helping the Rangers initiatives the most. The top four from the votes are honoured with the title of Champion! I was honoured in 2009 to be included in the list of the four champions and even more honoured that I have again been listed in the top 4!

Congrats to the other three champions and especially to Mathias Olausson, who was also re-awarded!

For more details on the latest Rangers champions see:

Article in the BB&D Newsletter

Submitted by Robert MacLean on Mon, 04/12/2010 - 08:44

After being at BB&D for almost two years, I finally managed to get an article in the BB&D newsletter! The article is about my trip in January to Canada and US for the ALM Rangers work! This was a different experience than writing for my blog, because this had to go through an editor and a copywriter before it was included. They made enough changes to the article that reading it myself, it felt strange because it sounds like me, just a different me. This article will now be shipped off to the BB&D offices around the world so that should be very exciting!


Click the image for a bigger view of it.

Thanks to Martin for spotting that the clicking of the image didn't give a bigger view, which is now fixed up.

Rangers Sabbatical, part 6 - What's Next?

Submitted by Robert MacLean on Fri, 02/12/2010 - 15:57

For more in this series, please visit the series index.

j0432558 Three weeks away from my family, 32900km in distance travelled, thousands of lines of code written, and hundreds of pictures taken what is the outcome of all of this and what do I do next?


One of the activities I took part in during my time in Seattle was a code review session of the work I had done. The outcome of that was a list of cleanup and fixes so I need to get that done, which means my weekends and evenings are not free. I also have documentation to do, part of that will be a blog series on the adapters and and another aspect will be a more formal lab guide so people can set it up.

Moving further from the integration project, the Rangers projects do not stop, in fact this is my forth one to date (and the biggest one I have done)! So I am sure when this moves from active development to a more maintenance cycle I will get involved in some other aspect of the Rangers work. I’m hoping that future projects involve testing TFS from the beaches in Hawaii ;)

image_2 MVP Summit

I mentioned in my last post that I will be fixing the lack of sightseeing in Seattle soon – well that will be happening from the 15th Feb! I will be back in Seattle for MVP Summit. This is a private Microsoft conference for people who have won the MVP award and is going to be packed with information, up close and personal time with the product team, and plenty of parties!

I am not going alone, this time I take with me Zayd Kara and Rudi Grobler (both of whom are MVP’s and both work with me at BB&D), so we will spend a few days there after MVP summit to have a look around Seattle! Seattle, you’ve been warning – The South Africans are coming!

For an insight into what summit will be like see the summit teams blog which is filled with info on places to go, sessions to see, what to eat and so on!


A final thanks is needed to the people that made this trip happen:

  • Willy-Peter – the force behind getting me there, organising everything, taking me snow shoeing, listening to me speaking endlessly on the busses, and opening his family and house up.
  • Carola – the force behind Willy-Peter and an amazing hostess. I was treated like royalty while I stayed with them and I loved our chats in the evenings.
  • Terry Y. – the unsung hero of these adapters. He works for Microsoft and spent a lot of time debugging issues in the adapters and integration platform with me.
  • Charles Sterling – opening up your home, feeding me better than I have ever been fed, and showing me life at Microsoft and America.
  • Bill E. – for taking the time out of your schedule to give me guidance!
  • Everyone who I met at Microsoft, who most I can’t remember your names because there were so many people, that made me feel very much at home!

Rangers Sabbatical, part 5 - Microsoft City

Submitted by Robert MacLean on Thu, 02/11/2010 - 10:48

800px-Microsoft_sign_closeup For more in this series, please visit the series index.

The second part of my trip, was a short stay in the city of Redmond (near Seattle, Washington, USA) which is where the worldwide headquarters of Microsoft are located. I knew it was big, but I suspected it would be more a big office park… I very quickly stopped thinking of it like an office park but rather like it’s own city, a Microsoft City because it is MASSIVE!

Let me take a step back here, I got off the bus from Vancouver and caught a cab to Microsoft. I expected to have to tell the driver where the Microsoft Campus was, but he knew – in fact he knew it so well, he even asked which building I wanted too (which did not help, since he still got lost looking for the building). Coming off the highway to Redmond all you see is the Microsoft Connector busses and shuttles (they have almost 60 busses alone) which are used to help the staff get around the massive place. A good review of all the transport, which is not just the busses and shuttles, is on the Microsoft Alternative Commuting page

I didn’t think to take a photo of the busses so here is one I found.

Once inside the buildings, for me that was building 41 (.NET Framework) & 25 (Team Foundation Server) you suddenly feel like you have stepped through the looking glass. Outside Microsoft looks very corporate, even sitting in reception in building 41 looks corporate (except the the people in shorts that walk past every so often); but inside the individuality of people and the passion of the teams shine. Everyone’s office there is different and reflects a lot of personality, be it covered with Australia themed items (like boomerangs) or Star Wars or cats there is plenty of variety.


Looking out of my temp office in Redmond, that is building 42 where ASP.NET finds their home.

The team passion also shines through when you walk around. There are monitors on the passage walls showing burn down charts, information on the number of outstanding bugs for releases and inspirational items. An example of the inspirational items I saw, was with the reporting section for TFS. This team have a section of the passage wall with a dozen or so different looking reports up there. I can imagine a developer standing there looking at them and getting inspired on how to improve their reports, or getting an idea on a different way to show data. For security and NDA reasons there are no photos of this, but if you looking for what it is like you should watch the a Channel 9 video where they tour the SQL Reporting Services team – it is EXACTLY like that.

In Vancouver I stayed with Willy-Peter and his family, which meant I needed a new family for Redmond and Charles Sterling agreed to open his family and house to me which was brilliant! Charles gave me deep insights into Microsoft life and the history at Microsoft which you would expect from someone with his depth of knowledge. However I did not know that Charles is also an AMAZING cook – the dinners at his house are some of the memories which I will remember for a long time. He also showed me what the life in America is like, things like shops being open at 10 at night, Netflix (which is a pipe dream in South Africa), self checkout (that is a dream for many criminals in South Africa) and played a lot of Halo 3 with me! It was a very enlightening experience and has really helped me normalise my views of America, which until then were very based off South African media and American movies and TV shows (oddly there is not nature disasters everywhere as shown in movies) so I owe Charles a huge thanks for all of that!

Unfortunately the time there was too short and too busy for me to do sightseeing, but I will fix that soon!

Rangers Sabbatical, part 4 - Sights of Vancouver

Submitted by Robert MacLean on Wed, 02/10/2010 - 09:31

DSC03214For more in this series, please visit the series index.

Vancouver, BC, Canada:

  • Host of the 2010 Winter Olympic and Paralympics games
  • Where the X-Files was shot for the first five seasons
  • Home of the Canucks ice hockey team
  • And where I stayed for two weeks!

While there I took a few hundred photo’s (thanks to my sister for lending me her camera) which I thought I would share. Not all of them, but some of the highlights that will stay in my memory long after my code is no longer used.



My laptop felt a little threatened by the two 24” monitors my desk came with.


If you ever wondered how Willy-Peter keeps pushing out content all the time…


After 5 days of no sun, when it finally came out, I went outside and took a picture (just in case it went away again) – South African’s are powered by the sun.

Dry Africa

While travelling I took a chance to drink all the drinks you no longer get in South Africa

DSC03107 DSC03108  DSC03049DSC03016



The floating Olympic sign with Stanley Park behind it – taken from the Sea Bus.


This Harry Potter like house is actually a house boat. I had never expected for them to look so much like houses.


FOOD! This was taken in Granville island, where you need loads more stomachs just to get through it.


As someone who had never seen snow before, one of my big highlights was when Willy-Peter and his family took me up Grouse Mountain to go snow shoeing!


At the base of Grouse Mountain – no surprises that they shot some of the X-Files here, it is just so spooky from below. Once up there is is beautiful.


Modern snow shoes aren’t like tennis rackets anymore.


Carola and one of our snow shoe guides on the top of the mountain!