New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

Connect to a Project Collection

91 Views
Copy Code Show/Hide Line Numbers
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
}
by Jim Lamb
  October 29, 2009 @ 7:45pm
Tags:

Add a comment


Report Abuse
brought to you by:
West Wind Techologies


If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate