[Mono-bugs] [Bug 52152][Maj] New - XmlIncludeAttribute does not function properly.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 14 Dec 2003 06:37:01 -0500 (EST)


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 erezl@mainsoft.com.

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

--- shadow/52152	2003-12-14 06:37:01.000000000 -0500
+++ shadow/52152.tmp.17704	2003-12-14 06:37:01.000000000 -0500
@@ -0,0 +1,91 @@
+Bug#: 52152
+Product: Mono/Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: System.XML
+AssignedTo: lluis@ximian.com                            
+ReportedBy: erezl@mainsoft.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XmlIncludeAttribute does not function properly.
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+Types included using XmlInclude attribute are not found during 
+deserialization of the including class. 
+
+Steps to reproduce the problem:
+1. Save the attached cs files.
+2. Compile each of them into a seperate executable (Console).
+3. Execute each of the applications.
+Actual Results:
+1. for the Including.cs, the following exception is thrown:
+Unhandled Exception: System.InvalidOperationException: There was an error 
+reflecting 'Including': Type 'Included' is not a subclass of 'Including'
+in <0x00501> 
+System.Xml.Serialization.XmlReflectionImporter:ImportClassMapping 
+(System.Type,System.Xml.Serialization.XmlRootAttribute,string)
+in <0x00106> 
+System.Xml.Serialization.XmlReflectionImporter:ImportTypeMapping 
+(System.Type,System.Xml.Serialization.XmlRootAttribute,string)
+in <0x000f0> System.Xml.Serialization.XmlSerializer:.ctor 
+(System.Type,System.Xml.Serialization.XmlAttributeOverrides,System.Type
+[],System.Xml.Serialization.XmlRootAttribute,string)
+in <0x00021> System.Xml.Serialization.XmlSerializer:.ctor (System.Type)
+in <0x0003f> .Deserializer:Main (string[])
+
+2. for the IncludingCollection.cs, the following exception is thrown:
+Unhandled Exception: System.InvalidOperationException: Invalid type: 
+Included
+in <0x0015f> 
+System.Xml.Serialization.XmlSerializationWriter:WriteTypedPrimitive 
+(string,string,object,bool)
+in <0x0020a> 
+System.Xml.Serialization.XmlSerializationWriterInterpreter:WriteObject 
+(System.Xml.Serialization.XmlTypeMapping,object,string,string,bool,bool,bo
+ol)
+in <0x00975> 
+System.Xml.Serialization.XmlSerializationWriterInterpreter:WriteMemberElem
+ent (System.Xml.Serialization.XmlTypeMapElementInfo,object)
+in <0x005af> 
+System.Xml.Serialization.XmlSerializationWriterInterpreter:WriteListConten
+t 
+(System.Xml.Serialization.TypeData,System.Xml.Serialization.ListMap,object
+,System.Text.StringBuilder)
+in <0x0018d> 
+System.Xml.Serialization.XmlSerializationWriterInterpreter:WriteListElemen
+t (System.Xml.Serialization.XmlTypeMapping,object,string,string)
+in <0x00308> 
+System.Xml.Serialization.XmlSerializationWriterInterpreter:WriteObject 
+(System.Xml.Serialization.XmlTypeMapping,object,string,string,bool,bool,bo
+ol)
+in <0x00145> 
+System.Xml.Serialization.XmlSerializationWriterInterpreter:WriteObject 
+(object)
+in <0x0007d> System.Xml.Serialization.XmlSerializer:Serialize 
+(object,System.Xml.Serialization.XmlSerializationWriter)
+in <0x000e6> System.Xml.Serialization.XmlSerializer:Serialize 
+(System.Xml.XmlWriter,object,System.Xml.Serialization.XmlSerializerNamespa
+ces)
+in <0x0005f> System.Xml.Serialization.XmlSerializer:Serialize 
+(System.IO.TextWriter,object)
+in <0x0013f> .Deserializer:Main (string[])
+
+Expected Results:
+Both examples should not throw any exception, but serialize the objects 
+into XML.
+
+How often does this happen? 
+Always.
+
+Additional Information:
+Deserialization of the XML pruduced in .NET run of these examples, will 
+also cause similar results, althogh it is o.k. in .NET