我在MS Team Foundation Server上以特定用户身份验证时遇到问题。在旧版本中,它看起来像:在TFS 2010上进行身份验证
teamFoundationCredential = new System.Net.NetworkCredential("<USERNAME>", "<PASSWORD>", "<DOMAIN>");
TeamFoundationServer tfs = new TeamFoundationServer("http://mars:8080/", teamFoundationCredential);
有人可以告诉我2010版的equivilent。到目前为止,我有:
ICredentialsProvider cred = null;
tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://asebeast.cpsc.ucalgar.ca:8080/tfs/DefualtCollection"));
tfs.EnsureAuthenticated();
感谢
注意这个工作对我来说是无域服务器上,如果我删除的用户名的“domain_par”部分。 – Simon 2011-12-02 11:36:38
我希望我能大约上百次。 – theo 2011-12-31 16:14:43
另外:你不需要NetworkCredential(“用户名”,“密码”,“域”)而不是NetworkCredential(“用户名\\域名”,“密码”),它对我来说是第一种方式,但不是第二种。 – theo 2011-12-31 16:15:58