TFS API Part 3: Get Project List Using ICommonStructureService


one comment

TFS API Part 3: Get Project List Using ICommonStructureService

In the first post about TFS API Part 1: Domain Picker we saw how to take TFS projects only by selecting them in the Domain Project Picker.

In the post I’ll saw how to take all project from the TFS Server.

Download Demo Project

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

Add using for Proxy,Client and Server.

using Microsoft.TeamFoundation.Client;

using Microsoft.TeamFoundation.Proxy;

using Microsoft.TeamFoundation.Server;

Connect to TFS Server

DomainProjectPicker dp = new DomainProjectPicker(DomainProjectPickerMode.None);



After selecting the desire TFS I’ll make TeamFoundationServer object:

  TeamFoundationServer tfs = dp.SelectedServer;


Create ICommonStructureService object that will take TFS Structure Service.


ICommonStructureService structureService = (ICommonStructureService)tfs.GetService(typeof(ICommonStructureService));



Use ListAllProjects method to get all Team Projects in the TFS.

ProjectInfo[] projects = structureService.ListAllProjects();

list_projects.DataSource = projects;



Download Demo Project

Add comment
facebook linkedin twitter email

Leave a Reply

one comment

  1. suneetha08/07/2009 ב 15:13


    Thankyou for your post.

    I want list usergroups in dropdown and then based on group selection I need to populate users in that perticular group.

    can you help me?