I'm a bit confused. The class implements the ISerializable interface. If
the class cannot be serialized by design, why does it implement the
interface? I ask these questions for two reasons, 1) to understand the .NET
framework classes better and 2) to better understand how I should design my
classes.
Thanks for YOUR understanding.
Robert Millman
> Hi Robert,
>
[quoted text clipped - 22 lines]
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" [MSFT] - 07 Apr 2006 03:43 GMT
Hi Robert,
I am sorry if I have any confusion.
If a class can be XML serialized did not depend on if the customer has
implement the ISerializable.
If we look into the MSDN, we will find the related class about the
ISerializable is under the namespace System.Runtime.Serialization.
While the XMLSerializer is under the namespace System.Xml.Serialization.
They are using different approach to do the serialization. e.g. In
XMLSerializer, it will generated dynamic assembly, but the
System.Runtime.Serialization will not.
Here are some link about Run-time Serialization for your reference.
Run-time Serialization
http://msdn.microsoft.com/msdnmag/issues/02/04/net/
Run-time Serialization, Part 2
http://msdn.microsoft.com/msdnmag/issues/02/07/net/
Run-time Serialization, Part 3
http://msdn.microsoft.com/msdnmag/issues/02/09/net/
So far we did not have a official document about which class can be xml
serialized.
Commonly a very simple class can be XML serialized.
So we have a tool as I post before to check the class you are developing.
Introducing XML Serialization
http://msdn2.microsoft.com/en-us/library/182eeyhh.aspx
If you still have any concern, please feel free to post here.
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.