[Mono-bugs] [Bug 335703] New: Serialization Exception on SortedList.Values
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Mon Oct 22 11:55:00 EDT 2007
https://bugzilla.novell.com/show_bug.cgi?id=335703
Summary: Serialization Exception on SortedList.Values
Product: Mono: Class Libraries
Version: 1.2
Platform: Macintosh
OS/Version: Mac OS X 10.5
Status: NEW
Severity: Normal
Priority: P5 - None
Component: CORLIB
AssignedTo: mono-bugs at ximian.com
ReportedBy: seanhig at geminibay.com
QAContact: mono-bugs at ximian.com
Found By: Customer
Basically it boils down to this:
ViewState["CurrentItems"] = (IList) someSortedList.Values;
will cause:
System.Runtime.Serialization.SerializationException: Type
System.Collections.SortedList+ListValues 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
System.Web.UI.ObjectStateFormatter+BinaryObjectFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+HashtableFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+PairFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+TripletFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ArrayListFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+TripletFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ArrayListFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+TripletFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ArrayListFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+TripletFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ArrayListFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+TripletFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ArrayListFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+TripletFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+PairFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+PairFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000] at System.Web.UI.ObjectStateFormatter.SerializeValue
(System.IO.BinaryWriter w, System.Object o) [0x00000] at
System.Web.UI.ObjectStateFormatter.Serialize (System.IO.Stream outputStream,
System.Object stateGraph) [0x00000] at
System.Web.UI.ObjectStateFormatter.Serialize (System.Object stateGraph)
[0x00000] at System.Web.UI.HiddenFieldPageStatePersister.Save () [0x00000]
at System.Web.UI.Page.SavePageStateToPersistenceMedium (System.Object
viewState) [0x00000] at System.Web.UI.Page.SavePageViewState () [0x00000]
at System.Web.UI.Page.InternalProcessRequest () [0x00000] at
System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000]
------------------------------------------------------------------------
Where someSortedList is a SortedList where the values are an array of
serializable objects (pocos). If I dump someSortedList.Values into an
ArrayList first, and then assigned the arraylist to the viewstate it works just
fine. However that offending line above does work in .NET.
--
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