[Mono-bugs] [Bug 673151] New: xsi:nil doesn't play nice with XmlSerializer

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 17 16:56:42 EST 2011


https://bugzilla.novell.com/show_bug.cgi?id=673151

https://bugzilla.novell.com/show_bug.cgi?id=673151#c0


           Summary: xsi:nil doesn't play nice with XmlSerializer
    Classification: Mono
           Product: MonoDroid
           Version: unspecified
          Platform: x86-64
        OS/Version: Windows 7
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: saml at itrgroupinc.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Description of Problem:
When you use the [XmlElement(ElementName="CustomElementName")] attribute on a
serializable, nullable value type, the serializer behaves differently than if
there was no XmlElementAttribute.

When there is no attribute, the value is serialized with xsi:nil="true"
When there is an XmlSerializerAttribute, the value is not added to the xml DOM
on serialization, and trying to serialize a nil element throws an error.

Steps to reproduce the problem:
1. Open repro project
2. Run

Actual Results:
The serializer behaving differently depending on whether an XmlElementAttribute
is included on a nullable value type, and an error parsing the value in
deserialization when the attribute is used on a nullable value that is nil.

Expected Results:
The nullable value to be parsed and displayed

How often does this happen? 
Every time

Additional Information:
Repro attached.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list