iXMLSerializable in .NET 2.0

I was trying to understand why  I was being told that the implementation of iXMLSerializable in DataTable and DataSet in 2.0 is responsible for all of the xml goodies (readxml/write/etc and of course all the webservices stuff) when DataSet in 1.0 and 1.1 does not even implement iXMLSerializable, yet still manages to do all of these things.

I know about the difference between using the binary formatter and the soap formatter, but I never worried about what was going on deeper down when datasets were “magically” serialized for me by ASMX.

After reassuring myself by looking at the DataSet Class documentation for 1.1 and seeing for sure that it implements iSerializable but not iXMLSerializable, I found this little goodie:

Dataset.iXMLSerializable.ReadXML Method  (This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.)

and realized that it MUST be in there, just buried/hidden. So I kept digging and digging .

I found the answer in the June 2004 MSDN article: “New Features for Web Service Developers in Beta 1 of the .NET Framework 2.0“ by Elliot Rapp,Yasser Shohoud and Matt Tavis.

“The IXmlSerializable interface has been in the .NET Framework since version 1.0, but was not intended for general usage. This interface was designed specifically for System.Data.DataSet to enable custom serialization control and was marked for internal use to discourage its usage. Full support for IXmlSerializable in ASP.NET Web services has been introduced in the .NET Framework 2.0 in direct response to customer feedback for scenarios that require more control of the schema and wire format.”

So it was basically hidden from view.  Now, hopefully I’ll be able to sleep so I’m off to bed.

  Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!  

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.