[Mono-bugs] [Bug 40881][Wis] New - XML serialization of enum caused InvalidCastException

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Mon, 7 Apr 2003 14:35:43 -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 gert.driesen@pandora.be.

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

--- shadow/40881	Mon Apr  7 14:35:43 2003
+++ shadow/40881.tmp.13998	Mon Apr  7 14:35:43 2003
@@ -0,0 +1,41 @@
+Bug#: 40881
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: Windows 2003
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gert.driesen@pandora.be               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XML serialization of enum caused InvalidCastException
+
+Description of Problem:
+
+When attemption to serialize an enum type using the XmlSerializer an 
+InvalidCastException is thrown : 
+
+Unhandled Exception: System.InvalidCastException: Cannot cast from source 
+type t
+o destination type
+in <0x001fe> 00 System.Xml.Serialization.XmlSerializer:Serialize 
+(System.Xml.Xml
+Writer,object,System.Xml.Serialization.XmlSerializerNamespaces)
+in <0x00059> 00 System.Xml.Serialization.XmlSerializer:Serialize 
+(System.IO.Text
+Writer,object)
+in <0x00069> 00 Tests.XmlSerializerTest:Main ()
+
+I'll attach a file that allows you to reproduce this issue.
+
+When executing the attached source file using the MS .NET runtime, I get 
+the following output (as expected) :
+
+<?xml version="1.0" encoding="Windows-1252"?>
+<TestValues>Value1 Value2</TestValues>