divyang4481 / xstream-dot-net

Automatically exported from code.google.com/p/xstream-dot-net
1 stars 1 forks source link

Multidimentional aobject array cannot be deserialized. #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When serializing a multidimentional array you get a fairly readable result:
<node type="InMemoryChild, App_Code.gtpb07oh, Version=0.0.0.0, 
Culture=neutral, PublicKeyToken=null">
  <name>sample</name> 
- <arrayOfValues2D>
  <string>Sample key</string> 
  <string>Sample value</string> 
  <string>Sample number</string> 
  <long>1024</long> 
  </arrayOfValues2D>
  </node>

However if you attempt to deserialize this same XML, you receive an 
exception:

System.ApplicationException: Couldn't set field arrayOfValues2D in object : 
Constructor on type 'System.Object[,]' not found. ---&gt; 
System.MissingMethodException: Constructor on type 'System.Object[,]' not 
found.
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, 
Binder binder, Object[] args, CultureInfo culture, Object[] 
activationAttributes)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, 
Binder binder, Object[] args, CultureInfo culture, Object[] 
activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at Xstream.Core.Converters.ArrayConverter.FromXml(Object parent, 
FieldInfo field, Type type, XmlNode xml, IMarshalContext context)
   at Xstream.Core.Converters.ObjectConverter.FromXmlAs(IMarshalContext 
context, Type type, Object value, XmlNode xml)
   --- End of inner exception stack trace ---
   at Xstream.Core.Converters.ObjectConverter.FromXmlAs(IMarshalContext 
context, Type type, Object value, XmlNode xml)
   at Xstream.Core.Converters.ObjectConverter.FromXml(Object parent, 
FieldInfo field, Type type, XmlNode xml, IMarshalContext context)
   at Xstream.Core.Converters.ObjectConverter.FromXmlAs(IMarshalContext 
context, Type type, Object value, XmlNode xml)
   --- End of inner exception stack trace ---
   at Xstream.Core.Converters.ObjectConverter.FromXmlAs(IMarshalContext 
context, Type type, Object value, XmlNode xml)
   at Xstream.Core.Converters.ObjectConverter.FromXml(Object parent, 
FieldInfo field, Type type, XmlNode xml, IMarshalContext context)
   at Xstream.Core.XStreamMarshaller.FromXml(String xml, IMarshalContext 
context)
   --- End of inner exception stack trace ---
   at Xstream.Core.XStreamMarshaller.FromXml(String xml, IMarshalContext 
context)
   at Xstream.Core.XStream.FromXml(String xml)
   at XStreamSerializer.deserialize(String str) in 
c:\Users\cgoudie\Documents\Visual Studio 
2008\WebSites\mm\App_Code\XStreamSerializer.cs:line 45

Original issue reported on code.google.com by cgoudien...@gmail.com on 8 Oct 2009 at 5:54