[Mono-bugs] [Bug 75823][Nor] New - Setting thread's current culture
to non-serializable CultureInfo causes SerializationException
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Tue Aug 16 06:38:29 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 gert.driesen at pandora.be.
http://bugzilla.ximian.com/show_bug.cgi?id=75823
--- shadow/75823 2005-08-16 06:38:29.000000000 -0400
+++ shadow/75823.tmp.26619 2005-08-16 06:38:29.000000000 -0400
@@ -0,0 +1,82 @@
+Bug#: 75823
+Product: Mono: Runtime
+Version: 1.1
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: gert.driesen at pandora.be
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Setting thread's current culture to non-serializable CultureInfo causes SerializationException
+
+When setting the thread's current culture to a non-serializable
+CultureInfo in a separate AppDomain a SerializationException is thrown.
+
+To reproduce this issue, compile and run the following code snippet:
+
+using System.Globalization;
+using System.Threading;
+
+public class Test
+{
+ public static void Main ()
+ {
+ Thread.CurrentThread.CurrentCulture = new MyCultureInfo ();
+ }
+
+ private sealed class MyCultureInfo : CultureInfo
+ {
+ internal MyCultureInfo () : base ("en-US")
+ {
+ }
+ }
+}
+
+Actual result:
+
+Unhandled Exception: System.Runtime.Serialization.SerializationException:
+Type Test+MyCultureInfo is not marked as Serializable.
+in <0x00099>
+System.Runtime.Serialization.Formatters.Binary.BinaryCommon:CheckSerializa
+ble (System.Type type, ISurrogateSelector selector, StreamingContext
+context)
+in <0x00106>
+System.Runtime.Serialization.Formatters.Binary.ObjectWriter:GetObjectData
+(System.Object obj,
+System.Runtime.Serialization.Formatters.Binary.TypeMetadata metadata,
+System.Object data)
+in <0x00020>
+System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteObject
+(System.IO.BinaryWriter writer, Int64 id, System.Object obj)
+in <0x00100>
+System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteObjectIns
+tance (System.IO.BinaryWriter writer, System.Object obj, Boolean
+isValueObject)
+in <0x0002d>
+System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteQueuedObj
+ects (System.IO.BinaryWriter writer)
+in <0x00037>
+System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteObjectGra
+ph (System.IO.BinaryWriter writer, System.Object obj,
+System.Runtime.Remoting.Messaging.Header[] headers)
+in <0x001f9>
+System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Serialize
+(System.IO.Stream serializationStream, System.Object graph, System.Runtime
+.Remoting.Messaging.Header[] headers)
+in <0x00012>
+System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Serialize
+(System.IO.Stream serializationStream, System.Object graph)
+in <0x0005c> System.Threading.Thread:set_CurrentCulture
+(System.Globalization.CultureInfo value)
+in <0x0003a> Test:Main ()
+
+Expect result:
+
+Successful execution.
More information about the mono-bugs
mailing list