[英]Error when trying to connect to Team Foundation Server
I'm trying to connect to our online TFS. 我正在尝试连接到我们的在线TFS。 This is what I currently have:
这是我目前拥有的:
NetworkCredential cred = new NetworkCredential(textBox_Username.Text,
textBox_password.Password);
Uri TFSurl = new Uri("https://myCompany.visualstudio.com/DefaultCollection");
TfsConfigurationServer tfs = new TfsConfigurationServer(TFSurl, cred);
tfs.EnsureAuthenticated();
This throws me : 这把我扔了:
TF30063: You are not authorized to access https://actacom.visualstudio.com/DefaultCollection .
TF30063:您无权访问https://actacom.visualstudio.com/DefaultCollection 。
The Credentials entered are correct. 输入的凭据正确。
The blog helped me out. 博客帮助了我。 For other people, here is the working code.
对于其他人,这是工作代码。
NetworkCredential netCred = new NetworkCredential(
textBox_Username.Text,
textBox_password.Password);
BasicAuthCredential basicCred = new BasicAuthCredential(netCred);
TfsClientCredentials tfsCred = new TfsClientCredentials(basicCred);
tfsCred.AllowInteractive = false;
TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(
new Uri("https://fabrikam.visualstudio.com/DefaultCollection"),
tfsCred);
tpc.Authenticate();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.