在连接到TFS使用TFS API认证失败 [英] authentication failed while connecting to tfs using tfs api

查看:395
本文介绍了在连接到TFS使用TFS API认证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面临着一个奇怪的issue.I想用TFS API programmitcally连接TFS服务器上。
即使给予适当authentcaion crediatials后是failing.But,如果我做手工在浏览器中键入TFS服务器名得到了连接。

I am facing a strange issue.I want to connect tfs server using tfs api programmitcally. Even after giving proper authentcaion crediatials it is failing.But if I do it manually by typing tfs server name in browser its got connected.

code:

TeamFoundationServer tfs = new TeamFoundationServer(new Uri("http://10.112.205.145:8080/tfs"),  new NetworkCredential(@"usrname", "pwd", "domain"));
tfs.EnsureAuthenticated()

请建议。

推荐答案

您是否尝试过做这种方式。

Have you tried doing it this way..

TfsTeamProjectCollection collection = new TfsTeamProjectCollection(
    new Uri(http://server:8080/tfs/DefaultCollection,
    new System.Net.NetworkCredential("domain_name\\user_name", "pwd"));
collection.EnsureAuthenticated();

这篇关于在连接到TFS使用TFS API认证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆