[Mono-bugs] [Bug 76808][Nor] Changed - Not expected behavior deserializing complex object with XmlSerializer

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Dec 4 18:59:34 EST 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 robertj at gmx.net.

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

--- shadow/76808	2005-11-26 20:50:10.000000000 -0500
+++ shadow/76808.tmp.12394	2005-12-04 18:59:34.000000000 -0500
@@ -56,6 +56,22 @@
 Thank you
 
 Regards,
 
 Daniel Leiszen
 
+
+------- Additional Comments From robertj at gmx.net  2005-12-04 18:59 -------
+You can fix the problem by removing the setter of the
+Entity.Children property. It's probably undocumented:
+collection properties don't need to have a setter to be
+able to be serialized. Moreover, .NET will never call the setter
+of such a property, because it reuses the object it has
+obtained from the getter.
+
+Mono behaves different: if it detects a setter, if will not
+reuse the collection obtained from the getter. It creates a new
+object instead and it first fills the object with the elements.
+At this time, the Container of your collection is null,
+because the setter will be called just after the collection
+has been filled.
+


More information about the mono-bugs mailing list