2013-06-03 30 views
2

我在TFS API上有代碼並且工作正常。但是,當我嘗試在不同的網絡域上,它有錯誤。錯誤是 - 「TF30063:您無權訪問http :: ///示例:8181 // tfs //」。TFS API不能在不同的域中工作

但我用來與代碼中的TFS服務器連接的用戶AC,這可以從VS-2012和網址中得到,但不能從TFS API中獲得。 TFS身份驗證中是否存在對不同域的任何依賴關係?

代碼 -

this.collection_string = 「HTTP :: // ABCD:8080/TFS /」 +集合名;

  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"); 
+0

你能顯示你的代碼嗎?特別是創建與TFS連接的代碼。 –

回答

1

嘗試使用您的TFS URL中的IP地址訪問您的TFS,而不是它的名稱。實際上,我早些時候遇到了同樣的問題,並通過IP地址訪問來解決問題。 另一種可能的解決方案是在本地機器中添加TFS服務器的主機條目。