var tfsCredentials = new TfsClientCredentials(new Microsoft.TeamFoundation.Client.WindowsCredential(), true);
TfsTeamProjectCollection teamCollection = new TfsTeamProjectCollection(new Uri(DomainConstants.BASE_ADDRESS), tfsCredentials);
return teamCollection;
我用它从当前登录用户身份验证TFS并获取TfsTeamProjectCollection,它从visual studio(localhost)运行时工作正常,但是当我在Server中部署我的项目时出现错误
浏览器和错误日志处理您的请求时出错
消息:TF30063:您无权访问 http://unicorntfs:8080/tfs/USP。
StackTrace:at Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.SendRequest() 在 Microsoft.TeamFoundation.Client.Channels.TfsHttpRequestChannel.Request(TfsMessage 消息,TimeSpan超时)at Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.Invoke(TfsClientOperation operation,Object []参数,TimeSpan超时,对象[]&输出)
在Microsoft.TeamFoundation.Server.Classification.ListProjects()at Microsoft.TeamFoundation.Proxy.CommonStructureService.ListProjects()
在 UnicornRMS.TimeManagement.Services.TFSTimeManagementServiceImpl.GetAllProjectsByUser(TfsTeamProjectCollection projCollection)at UnicornRSM.WEB.Controllers.TimeManagement.TimeManagementController.Index(的Int32 weekNo)
如何从当前登录用户
对TFS进行身份验证由于
答案 0 :(得分:0)
如果您要连接到域中的TFS服务器,则可以使用 NetworkCredential 进行身份验证:
var _credentials = new NetworkCredential(UserName, Password);
TfsTeamProjectCollection server = new TfsTeamProjectCollection(_tfsUri, _credentials);
server.EnsureAuthenticated();
此外,尝试删除已部署服务器上的IE缓存和cookie,然后再次尝试。
<强>更新强>
此问题可能与双跃点有关。一些类似的问题供您参考: