Lately I’ve been doing a fair bit of programming against the TFS. For most parts it’s been a good experience, what I’ve found most frustrating is the lack of good documentation. So in this post I’ve collected the links I’ve found most useful when developing against the TFS.
The functionality in the TFS can generally be accessed either directly through the web services in the application tier or through the TFS client-side object model. Always use the TFS object model. It may be tempting to use the other ways to alter the TFS but the API is intended to shield the application you write from eventual changes in the web service layer.
Buck Hodges has a number of code samples on his blog (many won’t run on the RTM version but will still serve as good examples). In particular this post has a set of links to other code samples.
These links to MSDN-online are good starting points with both general information and source code:
· How to: Use the TFS SDK to Write Code
· Work Item Tracking Extensibility
· Source Control Extensibility
For the best set of samples and documentation, download the Visual Studio 2005 SDK. The SDK contains various samples on how to use TFS, work items, source code control, check-in policies. The Visual Studio Industry Partners, VSIP, program has even more content on how to extend the Visual Studio suite including Team Foundation Server. VSIP requires registration but is free for the basic level of participation.
Buck Hodges has a post on “How to add the Team Foundation assemblies to the .NET tab in the VS Add Reference dialog”. Having the assemblies available in the "Add reference" dialog will save some time and confusion each time you want to access the TFS object model so it's definately something to setup. On that subject it is recommended to reference the Team Foundation Server assemblies from the SDK (%install path%\VisualStudioIntegration\Common\Assemblies\) instead of using the ones in Visual Studio private assemblies or on the TFS server.
These blogs also has a lot of good code samples to use as reference:
· Merrick Chaffer
· Jeff Attwood
And finally, look at CodePlex, there are a lot of TFS applications being written as open-source projects and the code can always be downloaded and used as a source of information.