Comment faire pour se connecter avec TFS et d'obtenir une liste de projets pour un utilisateur spécifique

public List<string> ListAllProjects(){    
TeamFoundationServer teamFoundationServer =
     TeamFoundationServerFactory.GetServer(@"http:\\ld-tfs08sp1:8080\\");    

teamFoundationServer.Authenticate();    
WorkItemStore workItemStore = new WorkItemStore(@"http:\\ld-tfs08sp1:8080\\");    

List<string> list = new List<string>();    

foreach (Project pr in workItemStore.Projects)    
{
        list.Add(pr.Name);    
}    

if (list.Count == 0)        
      list.Add("Not Found");    

return list;

}
  • Est-il question ici, ou êtes-vous juste de fournir un échantillon?
  • Cela ne fonctionne que pour les TFS 2008 de l'API. Avec 2010, vous devez vous connecter à une Collection de Projets d'Équipe
InformationsquelleAutor Amr Ramadan | 2010-08-05