當我流汗的字節的數據,我想轉換成的XElement像下面XElement.Load(流)拋出System.NotSupportedException
using (Stream streamResult = new MemoryStream(byteArray))
{
XElement xElement = XElement.Load(streamResult); // exception thrown here
}
這裏的異常詳細信息:
一'System.NotSupportedException' 類型 的第一次機會異常出現在system.xml.dll的PageRequest ::後處理: System.NotSupportedException:NotSupportedException異常在 System.Xml.XmlTextReaderImpl.ParseText(的Int32 & startPos,的Int32 & endPos, 的Int32 & outOrChars)處 System.Xml.XmlTextReaderImpl.get_Value() System.Xml.XmlTextReaderImpl.FinishPartialValue()在 System.Xml.Linq.XContainer.ReadContentFrom(的XmlReader r)是 System.Xml.Linq.XContainer.ReadContentFrom(XmlReader中R,LoadOptions O) 在System.Xml.Linq.XElement.ReadElementFrom(XmlReader中R,LoadOptions O)在System.Xml.Linq.XElement..ctor(的XmlReaderř ,LoadOptions O)
在System.Xml.Linq.XElement.Load(的XmlReader讀取器,LoadOptions 選項)在System.Xml.Linq.XElement.Load(流流, LoadOptions選項)
是XML的問題嗎?
原因包含在異常詳細信息中。如果沒有Message屬性的內容以及任何InnerException,就不能真正回答(除非你有完全相同的問題)。 – Will 2012-07-12 13:12:57
好的,我會更新它 – Rakesh 2012-07-12 13:18:35
這就是我可以幫助你。看起來所有的API都是正確的。可能是在XML中的東西。 – Will 2012-07-12 15:07:13