Get the SharePoint URL for a team project programmatically

I want to know by coding if this Team Project has an associated SharePoint. If so, I also want to get the URL for SharePoint to create a specific link for it.

I do not mean web access to TFS, but the associated SharePoint. Is there any way to find out without knowing the URL of a SharePoint server that is different from a TFS server?

+6
source share
1 answer
using Microsoft.TeamFoundation.Client; using Microsoft.TeamFoundation.Server; private static string RetrieveProjectPortalBaseAddress(TfsTeamProjectCollection tfs, string teamProject) { IRegistration registration = (IRegistration)tfs.GetService(typeof(IRegistration)); RegistrationEntry[] entries = registration.GetRegistrationEntries("TeamProjects"); ServiceInterface endpoint = entries[0].ServiceInterfaces.FirstOrDefault(si => si.Name == teamProject + ":Portal"); return endpoint.Url; } 
+6
source

All Articles