Search This Blog

Thursday, July 06, 2006

TFS API

Team Foundation API is wide open and straight forward you can do everything you do through the Team Explorer and command line using the API. I'll post some examples using this API using Visual Studio 2005 and C#.

Creating a Team Foundation server

You should add reference to: Microsoft.TeamFoundation.Client.dll

Team Foundation assemblies are located under: C:\Program Files\Microsoft Visual Studio 8\common\IDE\PrivateAssemblies.

On the using clause add:
using Microsoft.TeamFoundation.Client;

// Create the server object and connect to the server.
TeamFoundationServer teamServer = TeamFoundationServerFactory.GetServer(serverName);

// Check the connection
teamServer.EnsureAuthenticated();

Now you have a Team Foundation Server object to work with. Check out the TeamFoundationServer class using Reflector or ObjectExplorer to see other members of the class.

2 comments:

Anonymous said...

Could you add links to where one might find Microsoft.TeamFoundation.Client.dll or an installer of the redistributable client libraries - assuming these are free?

Dudu Shmaya said...

There's no redistributable client libraries package that I know of. You should install Team Explorer for Visual Studio and the files are located under: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies.