[Mono-bugs] [Bug 70570][Blo] New - BinaryFormatter not calling IObjectReference.GetRealObject on an Hashtable key
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Tue, 14 Dec 2004 19:14:38 -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 pre@oninetspeed.pt.
http://bugzilla.ximian.com/show_bug.cgi?id=70570
--- shadow/70570 2004-12-14 19:14:38.000000000 -0500
+++ shadow/70570.tmp.31957 2004-12-14 19:14:38.000000000 -0500
@@ -0,0 +1,48 @@
+Bug#: 70570
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Blocker
+Component: System
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: pre@oninetspeed.pt
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: BinaryFormatter not calling IObjectReference.GetRealObject on an Hashtable key
+
+Description of Problem:
+BinaryFormatter is not calling IObjectReference.GetRealObject on an
+Hashtable key object
+
+Steps to reproduce the problem:
+1. Checkout the attached code
+2. mcs BinaryFormatterBug.cs
+3. mono BinaryFormatter.exe
+
+Actual Results:
+System.Reflection.TargetInvocationException: Exception has been thrown by
+the target of an invocation. ---> System.ArgumentNullException: null key
+Parameter name: key
+
+Expected Results:
+No exceptions
+
+How often does this happen?
+Always... when using an Hashtable to store a key that is deserialized using
+a helper class that implements IObjectReference
+
+Additional Information:
+SoapFormatter works fine in this situation
+Also, Mono's BinaryFormatter does not complaint if we serialize something
+like this:
+class A : ISerializable {}
+
+
+However, in MS .NET we must have:
+[Serializable] class A : ISerializable {}