[Mono-bugs] [Bug 59495][Maj] New - The ObjectStateFormatter doesn't use type converters when availables, this may break code already running on MS implementation

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 2 Jun 2004 17:22:53 -0400 (EDT)


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 vga@aspnet2.com.

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

--- shadow/59495	2004-06-02 17:22:53.000000000 -0400
+++ shadow/59495.tmp.879	2004-06-02 17:22:53.000000000 -0400
@@ -0,0 +1,48 @@
+Bug#: 59495
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vga@aspnet2.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: The ObjectStateFormatter doesn't use type converters when availables, this may break code already running on MS implementation
+
+Description of Problem:
+When handling non-optimized types, the ObjectStateFormatter doesn't use 
+type converters when availables, it just feeds the type to a 
+BinaryFormatter which may cause an exception to be thrown if the type is 
+not marked as serializable.
+
+Steps to reproduce the problem:
+1. Define a dummy type and a dummy type converter. DO NOT mark the dummy 
+type with the Serializable attribute. DO NOT implement the ISerializable 
+interface also.
+2. Assign the dummy type converter to the dummy type by using the 
+TypeConverter attribute.
+3. Save an instance of the dummy type to viewstate.
+
+Actual Results:
+A SerializationException exception will be thrown. This is because the 
+ObjectStateFormatter is not using the type converter and it is just 
+feeding the type to the BinaryFormatter. The type is obviously not ready 
+to be serialized by the BinaryFormatter and the exception is thrown.
+
+
+Expected Results:
+No exceptions should be thrown. The ObjectStateFormatter should try to 
+use an associated type converter BEFORE using the BinaryFormatter.
+
+How often does this happen? 
+Always
+
+Additional Information:
+http://weblogs.asp.net/vga/archive/2004/06/02/MonoBreaksYourViewstate.aspx