TFS & Visual Studio ALM – by Neno Loje

(formerly Team System, VSTS)

Entries Tagged as 'TFS API'

Solved: The type ‘Microsoft.TeamFoundation.Framework.Client.ILocationService’ cannot be used as type parameter…

February 22nd, 2016 · 3 Comments · TFS Extensibility

The Problem You are receiving one of the following compiler errors: The type ‘Microsoft.TeamFoundation.Framework.Client.ILocationService’ cannot be used as type parameter ‘TService’ in the generic type or method ‘VssRequestContextExtensions.GetService<TService>(IVssRequestContext)’. There is no implicit reference conversion from ‘Microsoft.TeamFoundation.Framework.Client.ILocationService’ to ‘Microsoft.TeamFoundation.Framework.Server.IVssFrameworkService’. ‘ILocationService’ does not contain a definition for ‘GetSelfReferenceUri’ and no extension method ‘GetSelfReferenceUri’ accepting a first argument […]

[Read more →]

Tags:

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. Example: TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(collectionUri))) TfvcHttpClient tfvcClient = tpc.GetClient<TfvcHttpClient>(); See also “Example 3” at: […]

[Read more →]

Tags: