TFS在尝试进行身份验证时引发TeamFoundationServerInvalidResponseException

本文关键字:TeamFoundationServerInvalidResponseException 身份验证 TFS | 更新日期: 2023-09-27 18:20:37

我正在用程序从TFS中签出一些文件,在每次调用签出之前,我都会检查自己是否通过了身份验证。某些文件已正确签出,但有一个文件的Authenticate()方法失败,出现以下异常:

Microsoft.TeamFoundation.TeamFoundationServerInvalidResponseException: Wenden Sie sich an den Administrator. Fehler bei der Anforderung an den Server.
Technische Informationen (für Administrator):
  HTTP-Code 200: OK
   bei Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.ReadMessage(HttpWebResponse webResponse, WebException webException, Stream responseStream, Boolean& closeResponse)
   bei Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.ReadResponse(HttpWebResponse webResponse, WebException webException)
   bei Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.IsAuthenticationChallenge(TfsMessage requestMessage, HttpWebResponse webResponse, WebException webException, TfsMessage& responseMessage)
   bei Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.SendRequest()
   bei Microsoft.TeamFoundation.Client.Channels.TfsHttpRequestChannel.Request(TfsMessage message, TimeSpan timeout)
   bei Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.Invoke(TfsClientOperation operation, Object[] parameters, TimeSpan timeout, Object[]& outputs)
   bei Microsoft.TeamFoundation.Framework.Client.LocationWebService.Connect(Int32 connectOptions, Int32 lastChangeId, Int32 features)
   bei Microsoft.TeamFoundation.Framework.Client.FrameworkServerDataProvider.Connect(ConnectOptions connectOptions)
   bei Microsoft.TeamFoundation.Client.TfsConnection.EnsureProviderConnected()

有人知道我为什么要在这里得到这个InvalidResponse吗?我正在通过NuGet使用最新的TFS客户端程序集。身份验证基本上是这样完成的:

m_tfsServer = new TfsTeamProjectCollection(new Uri(serverUri), new TfsClientCredentials());
if(!m_tfsServer.HasAuthenticated)
    m_tfsServer.Authenticate();

TFS在尝试进行身份验证时引发TeamFoundationServerInvalidResponseException

通常我以以下方式进行:

             string STRuri=@"http://myserver/teamservercollection"
             TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(STRuri));                 
             VersionControlServer vcs = tpc.GetService<VersionControlServer>();
             Workspace workspace = vcs.GetWorkspace(System.Environment.MachineName, vcs.AuthenticatedUser);
相关文章:
  • 没有找到相关文章