Unable to generate a temporary class (result=1). error CS0030: Cannot convert type 'Type[]' to 'Type'?

前端 未结 7 1528
无人共我
无人共我 2020-12-04 23:16

I get this error after I created a class from my xsd file using the xsd.exe tool. So I searched the net and found a solution. Here is the link: http://satov.blogspot.com/200

相关标签:
7条回答
  • 2020-12-05 00:13

    For my case, the issue cases due to an invalid declaration for XmlArrayItem property attribute.

    From

    [XmlArrayItem("MyArray", typeof(string))]
    public List<ClassName> Items{ get; set; }
    

    I changed with appropriate type: from string to ClassName

    [XmlArrayItem("MyArray", typeof(ClassName))]
    public List<ClassName> Items{ get; set; }
    

    Hope this helps!

    0 讨论(0)
提交回复
热议问题