我正在使用C#中的GitHub REST API。代码工作正常,几天后,今天,我收到了这个错误。知道我应该从哪里开始吗?
Exception caught: System.ApplicationException: Error retrieving response. Check
inner details for more info. ---> System.Xml.XmlException: Reference to undeclared entity 'middot'. Line 7, position 28.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.HandleGeneralEntityReference(String name, Boolean isInAttributeValue, Boolean pushFakeEntityIfNullResolver, Int32 entityStartLinePos)
at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos)
at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
at System.Xml.XmlTextReaderImpl.FinishPartialValue()
at System.Xml.XmlTextReaderImpl.get_Value()
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
at RestSharp.Deserializers.XmlDeserializer.Deserialize[T](IRestResponse response)
at RestSharp.RestClient.Deserialize[T](IRestRequest request, IRestResponse raw)
--- End of inner exception stack trace ---
at DevOps.RestSharpAPI.Execute[T](RestClient client, RestRequest request) in
C:\2015\C#\DevOps\RESTLibrary\RestSharpAPI.cs:line 75
at DevOps.GitHubAPI.GetGitHubUser() in C:\2015\C#\DevOps\GitHub\GitHubAPI.cs:line 44
at DevOps.GitHubAPI.Main(String[] args) in C:\2015\C#\DevOps\GitHub\GitHubAPI.cs:line 169
答案 0 :(得分:0)
只是为了让你们知道,我不小心改变了这个:
static string baseUrl = "http://github.mycompany.com/api/v3";
到
static string baseUrl = "http://github.com/api/v3";
一旦我将其更改回来,错误就消失了。很难搞清楚。