C# xml serializer - Unable to generate a temporary class

Posted by gosom on Stack Overflow See other posts from Stack Overflow or by gosom
Published on 2010-05-17T08:09:59Z Indexed on 2010/05/17 8:20 UTC
Read the original article Hit count: 350

Filed under:
|
|

I am trying to serialize an xml to a class with the following way:

XmlSerializer ser = new XmlSerializer(typeof(PSW5ns.PSW5));
StringReader stringReader;
stringReader = new StringReader(response_xml);
XmlTextReader xmlReader;
xmlReader = new XmlTextReader(stringReader);
PSW5ns.PSW5 obj;
obj = (PSW5ns.PSW5)ser.Deserialize(xmlReader);
xmlReader.Close();
stringReader.Close();

the class PSW5 is generated automatically by xsd.exe using an PSW5.xsd file given to me. I have done the same for other classes and it works. Now i get the following error (during runtime) :

{"Unable to generate a temporary class (result=1).\r\nerror CS0030: 
Cannot convert type 'PSW5ns.TAX_INF[]' to 'PSW5ns.TAX_INF'\r\nerror CS0029: 
Cannot implicitly convert type 'PSW5ns.TAX_INF' to 'PSW5ns.TAX_INF[]'\r\n"}

I am confused because it works for other classes the same way. I would appreciate any suggestions. Thanks inadvance, Giorgos

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml