C# 从WCF服务验证联机TFS时出错
我正在尝试使用WCF服务连接在线TFS,但它向我抛出异常“TF30063:您无权访问” 下面是我的示例代码C# 从WCF服务验证联机TFS时出错,c#,wcf,C#,Wcf,我正在尝试使用WCF服务连接在线TFS,但它向我抛出异常“TF30063:您无权访问” 下面是我的示例代码 NetworkCredential netCred = new NetworkCredential( "*MyEmail*", "*MyPassword*"); BasicAuthCredential basicCred = new BasicAuthCredential(netCred); TfsClient
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();
}
任何帮助都将不胜感激。您是否尝试将域添加到用户名中?因此用户名将是YourDomain\abdul-r@hcl.comHi,谢谢您的迅速关注。由于这是windows live id,且TFS处于联机状态,因此无需提供域。我检查过了,NetworkCredential没有域,有重载方法可接受。任何其他想法都值得赞赏。