从WCF服务验证在线TFS时出错

时间:2015-02-04 10:52:36

标签: c# wcf

我正在尝试使用WCF服务连接在线TFS,但它让我异常“TF30063:您无权访问https://abdul-r.visualstudio.com/DefaultCollection/TestTFS。”。

以下是我的示例代码

NetworkCredential netCred = new NetworkCredential(
            "*MyEmail*",
           "*MyPassword*");
        BasicAuthCredential basicCred = new BasicAuthCredential(netCred);

        TfsClientCredentials credential = new TfsClientCredentials(basicCred);
        credential.AllowInteractive = false;

        string TFSServerPath = "https://abdul-r.visualstudio.com/DefaultCollection/TestTFS";

        using (TfsTeamProjectCollection tfs1 = new TfsTeamProjectCollection(new Uri(TFSServerPath), credential))
        {

            tfs1.EnsureAuthenticated();
        }

任何帮助都将不胜感激。

0 个答案:

没有答案