Connecting to a Team Foundation Server

March 17, 2006

You can use the following code to connect to a Team Foundation Server using the built in Connect dialog and User Authentication dialog.

using Microsoft.TeamFoundation.Proxy;

DomainProjectPicker domainProjectPicker =
new DomainProjectPicker(DomainProjectPickerMode.None); 

//Options for DomainProjectPickerMode
// DomainProjectPickerMode.AllowMultiSelect;
// DomainProjectPickerMode.AllowProjectSelect;
// DomainProjectPickerMode.DisableServerSelect;
// DomainProjectPickerMode.ForwardWndMsgOutsideVS;
// DomainProjectPickerMode.None;

TeamFoundationServer tfs;
(domainProjectPicker.ShowDialog() == DialogResult.OK)
  tfs= domainProjectPicker.SelectedServer;
new UICredentialsProvider());


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: