[Mono-bugs] [Bug 360429] New: DateTimeFormatInfo serialization is incompatible with . NET 2.0

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Feb 10 12:56:29 EST 2008


           Summary: DateTimeFormatInfo serialization is incompatible with
                    .NET 2.0
           Product: Mono: Class Libraries
           Version: 1.2.6
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: agallero at netscape.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

Created an attachment (id=194054)
 --> (https://bugzilla.novell.com/attachment.cgi?id=194054)
Small application to deserialize a DateTimeFormatInfo class

Description of Problem:
It looks like the DateTimeFormatInfo class changed in .NET 2.0 SP1 adding a new
member: dateTimeOffsetPattern that will break deserialization in mono.

I could not find much information on the issue more than this:


It affects many winforms applications created in Visual Studio that can not run
under mono without recompiling.

I am also not sure if there is a possible fix for this, if it was actually
introduced in 2.0 sp1, in order not to break non-sp1 applications.

Steps to reproduce the problem:
1) Compile and run serialize.cs in windows with .NET 2.0 sp1.  It will create
the file testdatetimeinfo.bin that is also attached.

2) Compile and run deserialize.cs in mono using gcs deserialize.exe.

Actual Results:
linux at linux:~/test> mono deserialize.exe

Unhandled Exception: System.Runtime.Serialization.SerializationException: Field
"dateTimeOffsetPattern" not found in class
(System.IO.BinaryReader reader, Boolean isRuntimeObject, Boolean hasTypeInfo)
(System.IO.BinaryReader reader, Boolean isRuntimeObject, Boolean hasTypeInfo,
System.Int64& objectId, System.Object& value,
System.Runtime.Serialization.SerializationInfo& info) [0x00000] 
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObject
(BinaryElement element, System.IO.BinaryReader reader, System.Int64& objectId,
System.Object& value, System.Runtime.Serialization.SerializationInfo& info)
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject
(System.IO.BinaryReader reader) [0x00000] 
(System.IO.BinaryReader reader, Boolean readHeaders, System.Object& result,
System.Runtime.Remoting.Messaging.Header[]& headers) [0x00000] 
(System.IO.Stream serializationStream,
System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000] 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize
(System.IO.Stream serializationStream) [0x00000] 
  at TestDateTimeInfoDeserialization.Main () [0x00000] 

Expected Results:
No error

How often does this happen? 

Additional Information:
I have found a similar bug:
but I believe this one is different enough to have its own reports, since in
the comments of 317058 says DateTieFormatInfo has been fixed.

Configure bugmail: https://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