Вы можете использовать этот пример C # для получения списка:
using System;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Framework.Client;
using Microsoft.TeamFoundation.Framework.Common;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
TfsConfigurationServer tfsc = new TfsConfigurationServer(new Uri("http://{server_name}:8080/tfs"));
tfsc.EnsureAuthenticated();
var collectionNodes = tfsc.CatalogNode.QueryChildren(
new[] { CatalogResourceTypes.ProjectCollection },
false, CatalogQueryOptions.None);
foreach(CatalogNode collection in collectionNodes)
{
Console.WriteLine("Collection {0} contains projects:", collection.Resource.DisplayName);
var tpc = tfsc.GetTeamProjectCollection(new Guid(collection.Resource.Properties["InstanceId"]));
var projectNodes = tpc.CatalogNode.QueryChildren(
new[] { CatalogResourceTypes.TeamProject },
false, CatalogQueryOptions.None);
foreach (CatalogNode project in projectNodes)
Console.WriteLine(project.Resource.DisplayName);
}
}
}
}
Ссылки на библиотеки в "C: \ Program Files (x86) \ Microsoft Visual Studio 14.0 \ Common7 \ IDE \ CommonExtensions \ Microsoft \TeamFoundation \ Team Explorer ":
- Microsoft.TeamFoundation.Client.dll
- Microsoft.TeamFoundation.Common.dll
Или вы можете попробовать Microsoft.TeamFoundationServer.ExtendedClient