Je ne suis pas certain à 100% ce que vous demandez ici, mais j'ai fait un code qui se connecte à l'aide du SDK TFS qui peut être utile pour vous:
private TfsTeamProjectCollection tfsServer = null;
private VersionControlServer vcsServer = null;
// This code is in a connection method
tfsServer = new TfsTeamProjectCollection(new Uri (pServerName));
tfsServer.EnsureAuthenticated();
vcsServer = (VersionControlServer)tfsServer.GetService(typeof(VersionControlServer));
Ensuite, vous pouvez extraire la collection de projet d'équipe en utilisant ce qui suit:
// attempt to extract a list of all projects
TeamProject[] projects = vcsServer.GetAllTeamProjects(true);
// add each one in turn to the list
foreach (TeamProject currentProject in projects)
{
}
Qu'est-ce qui "ne fonctionne pas"? TfContextManager revient-il à zéro? L'appel jette une exception ...? –