[Mono-bugs] [Bug 76094][Nor] New - Type System.CurrentTimeZone is not marked as Serializable

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Sep 13 17:39:32 EDT 2005

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 mono at kinitos.com.


--- shadow/76094	2005-09-13 17:39:32.000000000 -0400
+++ shadow/76094.tmp.17033	2005-09-13 17:39:32.000000000 -0400
@@ -0,0 +1,57 @@
+Bug#: 76094
+Product: Mono: Class Libraries
+Version: 1.1
+OS: GNU/Linux [Other]
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: mono at kinitos.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Type System.CurrentTimeZone is not marked as Serializable
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+I'm getting an exception trying to send an object of type DateTime from
+a Linux machine running Mono to a Windows one running .Net.  The 
+exception is "Type System.CurrentTimeZone is not marked as 
+Serializable."  System.TimeZone is supposedly serializable, but called 
+System.TimeZone.CurrentTimeZone returns something that isn't serializable.
+Interestingly enough, when I went in and marked the type as 
+[Serializable] and rebuild mono, I get an error deserializing the 
+object on Windows (it doesn't recognize the type of the CurrentTimeZone
+Steps to reproduce the problem:
+1. Attempt to serialize this class on Mono:
+class MyClass {
+    System.TimeZone  _TimeZone = System.TimeZone.CurrentTimeZone;
+    MyClass()
+    {
+        // Constructor
+    }
+2. Attempt to deserialize the serialized data on .Net
+Actual Results:
+#1 will fail because CurrentTimeZone is not serializable.  If the class is
+marked [Serializable] the attempt will succeed, but #2 will fail because
+the internal class CurrentTimeZone does not exist on .Net.
+Expected Results:
+The class should be serialized correctly, and should be deserializable on .Net.
+How often does this happen? 
+Every time
+Additional Information:
+This was observed on Mono 1.1.8

More information about the mono-bugs mailing list