XML Serialize question

  • Thread starter Thread starter Dominic
  • Start date Start date
D

Dominic

I am using XmlSerializer to serialize my object. The object has
various public members which are object references. This all works
fine.

However, one member (mShape) is declared as a reference to an abstract
base class, IShape. The member actually references a concrete subclass
such as Square or Circle.

Th serializer doesn't seem to be able to hand this. Any ideas on what
to do?

Dom
 
Dom,

The XML serializer can not handle abstract or interface references
because when deserializing the object, it will not know which type to create
and then populate with values.

If you want to serialize your objects in XML format and be able to
handle this, then you will have to use the SoapFormatter to serialize the
class.

Hope this helps.
 
Back
Top