【问题标题】:Programmatically connecting to TFS getting "TF30063: You are not authorized" error以编程方式连接到 TFS 得到“TF30063: You are not authorized”错误
【发布时间】: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


    【解决方案1】:

    使用 TFS API 连接到 Visual Studio Online 时,您需要 enable alternate credentials

    【讨论】:

    • 是的,这正是我所需要的。我不确定在哪里可以找到备用凭据。谢谢!
    猜你喜欢
    • 2012-01-11
    • 1970-01-01
    • 1970-01-01
    • 2018-02-14
    • 2022-12-29
    • 2019-06-11
    • 1970-01-01
    • 1970-01-01
    • 2013-04-15
    相关资源
    最近更新 更多