TFS & Visual Studio ALM – by Neno Loje

(formerly Team System, VSTS)

Q: How can I use an TfsTeamProjectCollection to authenticate against the REST API (*HttpClient)?

February 22nd, 2016 · No Comments · TFS Extensibility

Answer: If you are already authenticated against the “classic” TFS Object Model from the Microsoft.TeamFoundationServer.ExtendedClient NuGet Package  (typically having an instance of TfsTeamProjectCollection), you can use its GetClient<T> generic method to aquire an *HttpClient class from the REST API.


TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(collectionUri)))

TfvcHttpClient tfvcClient = tpc.GetClient<TfvcHttpClient>();

See also “Example 3” at:



No Comments so far ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment