How do I figure out what is really wrong with this line of code?


#1

I just today inherited support for a vb.net twitter based notification application because the previous guy quit. There is no documentation and a problem has occurred. The following line of code;
xDoc.LoadXml(FluentTwitter.CreateRequest().AuthenticateAs(userid, password).Statuses.OnUserTimeline.AsXml().Request())
Throws this error;
System.Xml.XmlException was unhandled by user code
LineNumber=8
LinePosition=6
Message=Invalid character in the given encoding. Line 8, position 6.
Source=System.Xml
SourceUri=http://www.openmobilealliance.org/tech/DTD/xhtml-mobile11.dtd
StackTrace:
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
at System.Xml.XmlTextReaderImpl.ReadData()
at System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type, Int32& outStartPos, Int32& outEndPos)
at System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type)
at System.Xml.XmlTextReaderImpl.DtdParserProxy_ParseComment(StringBuilder sb)
at System.Xml.XmlTextReaderImpl.DtdParserProxy.System.Xml.IDtdParserAdapter.ParseComment(StringBuilder sb)
at System.Xml.DtdParser.ParseComment()
at System.Xml.DtdParser.ParseSubset()
at System.Xml.DtdParser.ParseExternalSubset()
at System.Xml.DtdParser.ParseInDocumentDtd(Boolean saveInternalSubset)
at System.Xml.DtdParser.Parse(Boolean saveInternalSubset)
at System.Xml.DtdParser.System.Xml.IDtdParser.ParseInternalDtd(IDtdParserAdapter adapter, Boolean saveInternalSubset)
at System.Xml.XmlTextReaderImpl.ParseDtd()
at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.LoadXml(String xml)
at OutageNotificationTWINS.log.RefreshLog() in C:\Inetpub\wwwroot\OutageNotificationTWINS\OutageNotificationTWINS\log.aspx.vb:line 50
at OutageNotificationTWINS.log.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\OutageNotificationTWINS\OutageNotificationTWINS\log.aspx.vb:line 14
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:

Since I can’t see the actual xml stream it is complaining about, how do I figure out what it is really choking on?