[Mono-bugs] [Bug 52741][Wis] New - Cant deserialize a synced hashtable

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 10 Jan 2004 14:13:20 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bmaurer@users.sf.net.

http://bugzilla.ximian.com/show_bug.cgi?id=52741

--- shadow/52741	2004-01-10 14:13:20.000000000 -0500
+++ shadow/52741.tmp.912	2004-01-10 14:13:20.000000000 -0500
@@ -0,0 +1,57 @@
+Bug#: 52741
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Cant deserialize a synced hashtable
+
+using System;
+using System.IO;
+using System.Collections;
+using System.Runtime.Serialization.Formatters.Binary;
+
+class T {
+	static void Main ()
+	{
+		Hashtable h = Hashtable.Synchronized (new Hashtable ());
+		h.Add (1, null);
+		
+		BinaryFormatter f = new BinaryFormatter ();
+		MemoryStream s = new MemoryStream ();
+		f.Serialize (s, h);
+		s.Position = 0;
+		f.Deserialize (s);
+	}
+}
+
+We throw:
+Unhandled Exception: System.Runtime.Serialization.SerializationException:
+The constructor to deserialize an object of type
+System.Collections.Hashtable+SynchedHashtable was not found.
+in <0x001f8> System.Runtime.Serialization.ObjectRecord:LoadData
+(System.Runtime.Serialization.ObjectManager,System.Runtime.Serialization.ISurrogateSelector,System.Runtime.Serialization.StreamingContext)
+in <0x0011c> System.Runtime.Serialization.ObjectManager:DoFixups ()
+in <0x00047>
+System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadNextObject
+(System.IO.BinaryReader)
+in <0x000b8>
+System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadObjectGraph
+(System.IO.BinaryReader,bool,object&,System.Runtime.Remoting.Messaging.Header[]&)
+in <0x001dd>
+System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Deserialize
+(System.IO.Stream,System.Runtime.Remoting.Messaging.HeaderHandler)
+in <0x00019>
+System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Deserialize
+(System.IO.Stream)
+in <0x000db> .T:Main ()