I want to collect a List of Project in TFS 2013 Using API .
I am Putting URL and User name and Password, (Server properly Connected Browser).
I have collected all Project with TFS Collection List. But my API Call does not working on client. What is the problem?
Here My Sample Code
Uri configurationServerUri = new Uri(URL);
NetworkCredential credentials = new NetworkCredential(UserName, Password);
teamProjectCollection = new TfsTeamProjectCollection(configurationServerUri, credentials);// Set Connection
teamProjectCollection.EnsureAuthenticated();
//CatalogNode configurationServerNode = teamProjectCollection.TeamFoundationServer.TfsTeamProjectCollection.CatalogNode;
//li.Add(configurationServerNode.Resource.DisplayName);
TfsConfigurationServer configurationServer = TfsConfigurationServerFactory.GetConfigurationServer(configurationServerUri);
ITeamProjectCollectionService tpcService = configurationServer.GetService<ITeamProjectCollectionService>();
foreach (TeamProjectCollection tpc in tpcService.GetCollections())
{
list.Add(tpc.Name);
}