[Mono-bugs] [Bug 77591][Nor] New - XmlReflectionImporter allows XmlTextAttribute on member with primitive type

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Feb 18 10:26:08 EST 2006


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=77591

--- shadow/77591	2006-02-18 10:26:08.000000000 -0500
+++ shadow/77591.tmp.18305	2006-02-18 10:26:08.000000000 -0500
@@ -0,0 +1,52 @@
+Bug#: 77591
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.XML
+AssignedTo: lluis at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XmlReflectionImporter allows XmlTextAttribute on member with primitive type
+
+XmlReflectionImporter should throw an InvalidOperationException when 
+importing a member of a primitive type to which an XmlTextAttribute is 
+applied with a Type that differs from the type of the member.
+
+To reproduce, compile and run the following code snippet:
+
+using System.Xml.Serialization;
+
+public class EntryPoint
+{
+  static void Main ()
+  {
+    XmlReflectionImporter importer = new XmlReflectionImporter ();
+    importer.ImportTypeMapping (typeof (SimpleClass));
+  }
+}
+
+public class SimpleClass
+{
+  [XmlTextAttribute (typeof (byte[]))]
+  public string something = null;
+}
+
+Actual result:
+
+no failure
+
+Expected result:
+
+Unhandled Exception: System.InvalidOperationException: There was an error 
+reflecting type 'SimpleClass'. ---> System.InvalidOperationException: 
+There was an error reflecting field 'something'. ---> 
+System.InvalidOperationException: The type for XmlText may not be 
+specified for primitive types.


More information about the mono-bugs mailing list