XmlSerializer Code Generation component cannot handle nested unbounded elements when there is only one element - by mohanmg

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


5
0
Sign in
to vote
ID 471297 Comments
Status Closed Workarounds
Type Bug Repros 2
Opened 6/29/2009 10:24:35 PM
Access Restriction Public

Description

XmlSerializer Code Generation component: It cannot handle the xsd definitions that have only one element and the occurence of the element is unbounded.


<complexType name="pType">
       <sequence> 
  	<element name="Par" type="tns:nType" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
  </complexType>

The following thread discusses this issue in detail.
http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/thread/e33305c3-b5f6-4922-8a3f-df202088d25a
Sign in to post a comment.
Posted by zippy72 on 9/8/2017 at 6:33 AM
In my case the XML schema isn't under my control. Not sure how fixing a bug that causes crashes is "avoiding the risk of regression", it sounds more like a poor excuse to me.
Posted by Microsoft on 7/14/2009 at 2:59 PM
This is a known issue in the XmlSerializer. To avoid the risk of regression we are only fixing customer blocking issues in the XmlSerializer. You can work around this issue by adding a dummy attribute to the XML schema that you generate the serialization code from.

Thank you

Daniel Roth
Program Manager
Posted by mohanmg on 7/14/2009 at 2:00 AM
This bug does not happen when there are more than 1 elements in the complexType. Even for the case when there is just one element with maxOccurs=unbounded, the bug does not happen always. There is a specific pattern for which this bug happens.


Posted by Frank D Xu on 7/8/2009 at 9:37 PM
Please advise if the fix is availiable.
Does this bug happen when there are more than 1 elements, and the maxOccurs is unbounded?

eg.
<complexType name="pType">
<sequence>
    <element name="Par" type="tns:nType" minOccurs="0" maxOccurs="unbounded"/>
    <element name="Xyz" type="tns:nType" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
Posted by Microsoft on 7/1/2009 at 12:11 AM
Thanks for your feedback. We are routing this bug to the product unit who works on that specific feature area. The team will review this issue and make a decision on whether they will fix it or not for the next release.

Thank you,
Visual Studio Product Team