Re: XML Serialize question
From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 08/02/04
- Next message: Ignacio Machin \( .NET/ C# MVP \): "Re: pass string between two programs"
- Previous message: Nicholas Paldino [.NET/C# MVP]: "Re: Another question about XML Serialize"
- In reply to: Dominic: "XML Serialize question"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 2 Aug 2004 09:44:31 -0400
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
"Dominic" <dominicsmith501@hotmail.com> wrote in message
news:514ecc2b.0408011530.52cdfc10@posting.google.com...
> 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
- Next message: Ignacio Machin \( .NET/ C# MVP \): "Re: pass string between two programs"
- Previous message: Nicholas Paldino [.NET/C# MVP]: "Re: Another question about XML Serialize"
- In reply to: Dominic: "XML Serialize question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|