[Mono-list] More Serialization Problems

Lluis Sanchez lluis@ideary.com
Mon, 30 Jun 2003 14:17:35 +0200


Hey Robert,

I don't get this error with the sources you provided. I get the "SVG.Path
was not expected" exception.
In any case, you can't apply XmlElementAttribute and XmlArrayItemAttribute
to the same member. You must use either one or the other.
With  [XmlElementAttribute(ElementName="ArrayList", Type=typeof(Path))]
XmlSerializer will generate an xml element named "ArrayList" for each item
of the list.
With [XmlArrayItem("path",typeof(Path))] XmlSerializer will generate an
element named Paths and one child element named path for each item.

- Lluis

----- Original Message ----- 
From: "Robert Caskey" <rcaskey@uga.edu>
To: <mono-list@lists.ximian.com>
Sent: Monday, June 30, 2003 5:49 AM
Subject: [Mono-list] More Serialization Problems


> Hrm,  I'm getting a runtime error:
> rcaskey@r3wt:~$ mono Wilkins.exe
>
> Unhandled Exception: System.NullReferenceException: A null value was
> found where an object instance was required
> in <0x00236> 00 System.Xml.Serialization.XmlSerializer:SerializeMembers
> (System.Xml.XmlWriter,object,bool)
> in <0x006b5> 00 System.Xml.Serialization.XmlSerializer:WriteElement
>
(System.Xml.XmlWriter,System.Xml.Serialization.XmlAttributes,string,string,S
ystem.Type,object)
> in <0x00eb1> 00 System.Xml.Serialization.XmlSerializer:SerializeMembers
> (System.Xml.XmlWriter,object,bool)
> in <0x00a02> 00 System.Xml.Serialization.XmlSerializer:Serialize
>
(System.Xml.XmlWriter,object,System.Xml.Serialization.XmlSerializerNamespace
s)
> in <0x00071> 00 System.Xml.Serialization.XmlSerializer:Serialize
> (System.IO.Stream,object)
> in <0x00089> 00 SVG.Document:DocumentXML ()
> in <0x000c3> 00 SVG.Test:Main ()
>
> Full src & compiled version available at:
>
> http://robshouse.sytes.net/~robertj/wilkins/src/
>
> I am just stumped by this and have been working on it for a few days,
> got a good hint from Lluis Sanchez(thanks) earlier but I still can't get
> it to work right. Any help would be...err..helpful.
>
> Thanks,
> Rob J. Caskey
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>