2

我有关于 TFS API 的代码并且工作正常。但是当我在不同的网络域上尝试时,它得到了错误。错误是 - “TF30063:您无权访问 http:///example:8181//tfs//。”

但是我用来在代码中连接 TFS 服务器的用户 AC,从 VS-2012 和 Web URL 可以,但不能从 TFS API。不同域对 TFS 身份验证有任何依赖关系吗?

代码 -

this.collection_string = "http:://abcd:8080/tfs/" + collectionName;

            this.projectCollection = new TfsTeamProjectCollection(new Uri(this.collection_string), new NetworkCredential("username", "password", "domain"));
            projectCollection.EnsureAuthenticated();

            this.versionControllerServer = (VersionControlServer)this.projectCollection.GetService(typeof(VersionControlServer));
            this.buildServer = (IBuildServer)this.projectCollection.GetService(typeof(IBuildServer));
            Console.WriteLine("Connected successfully to the server");
4

1 回答 1

1

尝试使用 TFS URL 中的 IP 地址而不是其名称来访问您的 TFS。实际上,我之前遇到过同样的问题,通过IP地址访问它就解决了。另一种可能的解决方案是在本地计算机中添加 TFS 服务器的主机条目。

于 2013-12-06T10:56:18.717 回答