[Mono-bugs] [Bug 588198] New: DateTime class in corlib doesn't implement ISerializable

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Mar 13 17:34:35 EST 2010


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

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


           Summary: DateTime class in corlib doesn't implement
                    ISerializable
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: pavel.savara at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.8)
Gecko/20100202 Firefox/3.5.8

DateTime class in mono corlib doesn't implement ISerializable whereas Microsoft
version does. Please add the interface to the class, even if it will throw
NotImplemented exception.

My use-case:
I have code generator, which uses reflection to generate proxies for .NET
classes. I run the generator on Microsoft CLR. It finds ISerializable interface
and it's GetObjectData() method and generates wrapper for it, which calls the
method. Such generated code doesn't compile on Mono.

Workaround:
I can tweak the generator to skip the interface for this particular interface.
So the wrapper will not contain the method.

Discussion:
I wonder how far the compatibility with Microsoft should go. I seen
http://www.mono-project.com/PlanSerialization and see the complexity.
I admit that nobody if probably interested to call the ISerializable interface
explicitly, because it's mainly implementation detail of serialization. On the
other hand, the interface is public on the class, so anyone could cast DateTime
to it. 

Reproducible: Always

Steps to Reproduce:
This code compiles with Microsoft, but not with Mono.
System.DateTime x = DateTime.Now;
System.Runtime.Serialization.ISerializable s = x;
Actual Results:  
error CS0030: Cannot convert type `System.DateTime' to
`System.Runtime.Serialization.ISerializable'

Expected Results:  
compiled assembly

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


More information about the mono-bugs mailing list