[Mono-bugs] [Bug 503585] New: Comparer<T>.Default not Serializable for some types

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed May 13 15:28:13 EDT 2009


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


           Summary: Comparer<T>.Default not Serializable for some types
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.4.x
          Platform: x86
        OS/Version: openSUSE 11.1
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: generics
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: mtraudt at quantifisolutions.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10)
Gecko/2009042700 SUSE/3.0.10-2.1 Firefox/3.0.10

I have a C# struct, Dt, that is marked Serializable.  If I attempt to serialize
the object returned by Comparer<Dt>.Default, I get the error below.  The same
code works fine on Windows with .NET 3.5.  Strangely, I do not get this error
if instead I call Comparer<int>.Default or Comparer<string>.Default.


Unhandled Exception: System.Runtime.Serialization.SerializationException: Type
System.Collections.Generic.Comparer`1+DefaultComparer[Dt] is not marked as
Serializable.
  at
System.Runtime.Serialization.Formatters.Binary.BinaryCommon.CheckSerializable
(System.Type type, ISurrogateSelector selector, StreamingContext context)
[0x00000] 
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData
(System.Object obj,
System.Runtime.Serialization.Formatters.Binary.TypeMetadata& metadata,
System.Object& data) [0x00000] 
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject
(System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x00000] 
  at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance
(System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject)
[0x00000] 
  at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects
(System.IO.BinaryWriter writer) [0x00000] 
  at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph
(System.IO.BinaryWriter writer, System.Object obj,
System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
(System.IO.Stream serializationStream, System.Object graph,
System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
(System.IO.Stream serializationStream, System.Object graph) [0x00000] 
  at Test.Serialize (System.Object taskState) [0x00000] 
  at Test.Main (System.String[] args) [0x00000] 

Reproducible: Always

Steps to Reproduce:
1. Compile and run the attached C# program on Linux with Mono 2.4
2. 
3.

-- 
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