Nig*_*sey 6 api service tfs credentials networkcredentials
我正在尝试在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();
Run Code Online (Sandbox Code Playgroud)
在我尝试连接到TFS的那一刻,我正在使用我自己的Live用户名和密码,它给出了错误消息"TF30063:您未经授权".我不确定与TFS建立连接的不同方法.
我相信正确的方法是使用服务凭据,但目前我无法锻炼如何找到服务凭据我不知道如何在TFS中找到我的服务凭据.