[Mono-bugs] [Bug 601785] New: DataContractSerializer must invoke constructor before calling ReadXml on IXmlSerializable types

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun May 2 14:56:42 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=601785

http://bugzilla.novell.com/show_bug.cgi?id=601785#c0


           Summary: DataContractSerializer must invoke constructor before
                    calling ReadXml on IXmlSerializable types
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: atsushi at ximian.com
        ReportedBy: harinath at hurrynot.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.4
(KHTML, like Gecko) Chrome/5.0.375.28 Safari/533.4

DataContractSerializer uses FormatterServices.GetUninitializedObject on an
IXmlSerializable type, and invokes ReadXml on the raw object.

On the other hand, XmlSerializer uses Activator.CreateInstance before invoking
ReadXml.  I believe that the XmlSerializer usage of IXmlSerializable is
definitive.  ReadXml can and should assume that it is invoked on a fully
constructed object (albeit, constructed from a parameterless constructor).

In any case, the attached testcase works fine on .NET but null-refs on Mono
trunk.


Reproducible: Always





(distilled from a WCF session invoking a method that returned a DataTable)

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list