Quantcast
Channel: Team Foundation Server - General forum
Viewing all articles
Browse latest Browse all 6687

Where is "ServerAccessMapping" in TFS 2012?

$
0
0

We use to have different plugins in TFS 2010 that use "ServerAccessMapping" from TeamFoundationLocationService and it seems to get removed from Microsoft.TeamFoundation.Framework.Server.dll 11.0.

So these codes are no longer built. 

  var tfsLocalService = requestContext.GetService<TeamFoundationLocationService>();
                    var tfsUri = tfsLocalService.GetSelfReferenceUri(requestContext, tfsLocalService.ServerAccessMapping);
                    var tfsTeamProjectCollection = new TfsTeamProjectCollection(tfsUri);
                    var buildService = tfsTeamProjectCollection.GetService(typeof(IBuildServer)) as IBuildServer;
                    var teamProject = buildService.GetBuild(new Uri(@event.Build.Uri)).TeamProject;

Note: we prefer to use this codes in getting Team Collections/Project rather have to pass in the TFS URI.


Viewing all articles
Browse latest Browse all 6687

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>