TFS API Part 2: Domain Picker Using Registered Servers (Cache)

12/01/2009

3 comments

TFS API Part 2: Domain Picker Using Registered Servers (Cache)

In my previous post about TFS API Part 1: Domain Picker I showed how to use DomainPicker to connect TFS server.

In this post I’ll show how to connect and get TFS Servers using Registered Servers.

*** The disadvantage in this method is that you rely on your local computer cache.***

First add reference for Microsoft.TeamFoundation.Client
located in – C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\

Download Demo Project

All you need to do is:

TeamFoundationServer[] tfs_list = RegisteredServers.GetServers();

 

image

 

To connect TFS:

 

ICredentialsProvider provider = new UICredentialsProvider();

TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(comboBox1.Text,provider);

 

image

 

Download Demo Project

Add comment
facebook linkedin twitter email

Leave a Reply

3 comments

  1. asha30/03/2010 ב 17:39

    Do you know how i can through the API check if a user has access to a certain folder in TFS.

  2. asha30/03/2010 ב 17:40

    Do you know how i can check if a user has access to a certain folder in TFS.

    At the moment i can get a list of the users workspaces but not which folder in TFS they have access to.

  3. shair02/04/2010 ב 17:18

    Hi,
    Do you mean Source Control Folder?