Wrong data contract code generation with "Public properties" and "List<T>"

Sep 22, 2009 at 3:56 PM

When I generate Data Contract Code with the options "Public properties"=true and "List<T>"=true the resulting code is not compilable. Here is a code fragment:

 

 

private System.Collections.Generic.List<uint> itemsField;

/// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("Items", typeof(uint), Order=0)]
        [System.Xml.Serialization.XmlElementAttribute("MAX-LENGTH", typeof(uint), Order=0)]
        [System.Xml.Serialization.XmlElementAttribute("MIN-LENGTH", typeof(uint), Order=0)]
        [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")]
        public uint[] Items
        {
            get
            {
                return this.itemsField;
            }
            set
            {
                this.itemsField = value;
            }
        }

 

 

As you can see the following compile error occurs: Error    3    Cannot implicitly convert type 'System.Collections.Generic.List<xxx.ItemsChoiceType1>' to 'xxx.ItemsChoiceType1[]'

I used the V1_Beta2_(1.0.4) version.

Is this a known issue?

 

Greets

Kai

Oct 5, 2009 at 10:28 AM

Hi Kai,

I will file a bug and will test this out as soon as possible.

Thanks

Benjy

Oct 5, 2009 at 10:29 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.