I'm performing a migration of TFS 2010 team projects to TFS 2015 by using the TFS API. I'm running into an issue when attempting to call VersionControlServer.GetLatestChangesetId()
and VersionControlServer.QueryHistory(...)
.
I am using the nuget Team Foundation packages for 2015 to provide dlls.
The exception I am getting is:
'VersionControlServer.GetLatestChangesetId()' threw an exception of type 'System.Xml.XmlException'
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146232000
HelpLink: null
InnerException: null
LineNumber: 0
LinePosition: 0
Message: "Unexpected end of file."
Source: "System.Runtime.Serialization"
SourceUri: null
StackTrace: " at System.Xml.EncodingStreamWrapper.ReadBOMEncoding(Boolean notOutOfBand)\r\n at System.Xml.EncodingStreamWrapper..ctor(Stream stream, Encoding encoding)\r\n at System.Xml.XmlUTF8TextReader.SetInput(Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose)\r\n at Microsoft.TeamFoundation.Client.Channels.TfsSoapMessageEncoder.ReadMessage(Stream stream)\r\n at Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.ReadMessage(HttpWebResponse webResponse, WebException webException, Stream responseStream, Boolean& closeResponse)\r\n at Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.ReadResponse(HttpWebResponse webResponse, WebException webException)\r\n at Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.IsAuthenticationChallenge(TfsMessage requestMessage, HttpWebResponse webResponse, WebException webException, TfsMessage& responseMessage)\r\n at Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.SendR
equest()\r\n at Microsoft.TeamFoundation.Client.Channels.TfsHttpRequestChannel.Request(TfsMessage message, TimeSpan timeout)\r\n at Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.Invoke(TfsClientOperation operation, Object[] parameters, TimeSpan timeout, Object[]& outputs)\r\n at Microsoft.TeamFoundation.VersionControl.Client.Repository.GetRepositoryProperties()\r\n at Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer.GetLatestChangesetId()"
TargetSite: {SupportedEncoding ReadBOMEncoding(Boolean)}
The exception is basically identical for QueryHistory
and GetLatestChangesetId
. From the stacktrace it looks like TFS may be handling encoding differently between from 2010 to 2015.
I am looking for a solution that will allow me to query both the legacy TFS 2010 and our new TFS 2015 via the API.