[Mono-dev] Error Deserializing with XmlSerializer feeding off of XLinq XML Reader
Dan Shechter
dans at houmus.org
Wed Aug 27 22:01:55 EDT 2008
Hi all,
I've found an error with XLinq (?) running on Ubuntu 8.04 amd64:
When trying to use an XMLSerializer to de-serialize data that was
read/manipulated with XLinq,
The deserializer fails with the following exception:
at System.Xml.XmlReader.get_Name () [0x00000]
at
System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadAttributeMemb
ers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean
isValueList) [0x00000]
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers
(System.Xml.Serialization.ClassMap map, System.Object ob, Boolean
isValueList, Boolean readByOrder) [0x00000]
at
System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance
Members (System.Xml.Serialization.XmlTypeMapping typeMap, System.Object ob)
[0x00000]
at
System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance
(System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable,
Boolean checkType) [0x00000]
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject
(System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable,
Boolean checkType) [0x00000]
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot
(System.Xml.Serialization.XmlTypeMapping rootMap) [0x00000]
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot ()
[0x00000]
at System.Xml.Serialization.XmlSerializer.Deserialize
(System.Xml.Serialization.XmlSerializationReader reader) [0x00000]
The deserializer was called like this:
var xr = doc.CreateReader();
var me = _serializer.Deserialize(xr) as ChannelConfiguration;
The same code compiles and runs cleanly with MS .NET.
The same deserializer has no problem reading XmlDocuments that are fed to it
with:
var xr = new XmlNodeReader(doc);
var me = _serializer.Deserialize(xr) as ChannelConfiguration;
I will file an official bug report at a later time.
If anyone has any idea of how to circumvent this (while still using XLinq /
XDocument as the source for deserialization) I will be most greatful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080828/e23b7e89/attachment.html
More information about the Mono-devel-list
mailing list