2

我找不到过时的TfsTeamProjectCollection构造函数的替代品。这是我当前的代码(有效):

UICredentialsProvider uiCredentialsProvider = new UICredentialsProvider();
TfsTeamProjectCollection teamProjectCollection = new TfsTeamProjectCollection(new Uri("tpc uri"), new NetworkCredential("username", "pass", "domain"), uiCredentialsProvider);

如果自定义凭据失败,此代码会引发 tfs 登录对话框。文档指出,TfsClientCredentials应该使用带有类的构造函数而不是这个。
我如何UICredentialsProviderTfsClientCredentials课堂上使用?

4

1 回答 1

0

You could use the TeamProjectPicker class which provides a dialog to select a collection of TeamFoundation projects. Microsoft.TeamFoundation.Client

TeamProjectPicker tfsPP = new TeamProjectPicker(TeamProjectPickerMode.MultiProject, false, new UICredentialsProvider());
tfsPP.ShowDialog();

Also, you could look at the TfsClientCredentials class with the following constructor. You could then pass this object in.

TfsClientCredentials ( WindowsCredential windowsCredential, bool allowInteractive )

于 2013-01-02T20:08:46.117 回答