XSD.exe throwing out ‘Unable to generate a temporary class (result=1). error CS0030: Cannot convert type’
Unable to generate a temporary class (result=1). error CS0030: Cannot convert type 'SomeType[]' to 'SomeType' error CS0029: Cannot implicitly convert type 'SomeType' to 'SomeType[]'
If you’re using xsd.exe to generate proxy classes and getting the above error, it has something to do with a bug on xsd.exe for not correctly handling multidimensional array in the generated class.
If you are indeed expecting a multidimensional array, find the multidimensional array property and change typeof(SomeType) to typeof(SomeType[])
for.eg
[System.Xml.Serialization.XmlArrayItemAttribute("SomeType", typeof(SomeType[]), IsNullable=false)] public SomeType[][] PropertyName
If you’re generating the xsd from the xml, it could be that you’re not really expecting a multidimensional array. So, we want to do the opposite to remove the type of the property to single dimension array.
for e.g
[System.Xml.Serialization.XmlArrayItemAttribute("SomeType", typeof(SomeType), IsNullable=false)] public SomeType[] PropertyName
I am on .Net 3.5 VS2010.
About this entry
You’re currently reading “XSD.exe throwing out ‘Unable to generate a temporary class (result=1). error CS0030: Cannot convert type’,” an entry on Ronald Widha
- Published:
- 24.11.10 / 8pm
- Category:
- Articles

View Comments
Jump to comment form | comments rss [?] | trackback uri [?]