Language: C#
Connect to a Project Collection
using System.Net; using Microsoft.TeamFoundation; using Microsoft.TeamFoundation.Client; // Connect to a project collection by Uri try { Uri projectCollectionUri = new Uri("http://tfs2010:8080/tfs/MyCollection"); TeamFoundationServer tfs = new TeamFoundationServer(projectCollectionUri, new UICredentialsProvider()); tfs.EnsureAuthenticated(); } catch (TeamFoundationServerUnauthorizedException ex) { // handle access denied } catch (TeamFoundationServiceUnavailableException ex) { // handle service unavailable } catch (WebException ex) { // handle other web exception }
Tags:
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

