【发布时间】:2014-03-21 15:00:01
【问题描述】:
我正在尝试用 c# 创建一个程序,它允许我连接到我的 TFS 以创建新的工作项。
NetworkCredential netCred = new NetworkCredential(
"username",
"password");
BasicAuthCredential basicCred = new BasicAuthCredential(netCred);
TfsClientCredentials tfsCred = new TfsClientCredentials(basicCred);
tfsCred.AllowInteractive = false;
TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(
new Uri("https://example.visualstudio.com/DefaultCollection"),tfsCred);
tpc.Authenticate();
当我尝试连接到 TFS 时,我正在使用我自己的 Live 用户名和密码,这给了我错误消息“TF30063: You are not authorized”。我不确定连接到 TFS 的不同方式。
我相信正确的方法是使用服务凭据,但目前我无法确定如何找到服务凭据,我不知道如何在 TFS 中找到我的服务凭据。
【问题讨论】:
标签: api service tfs credentials networkcredentials