The XML element named 'name' from namespace references distinct types

Bladinium

New Member
Please help. I've got an error while deserializing the data from the server,\[quote\] The top XML element 'Name' from namespace '' references distinct types Object1.LocalStrings and System.String. Use XML attributes to specify another XML name or namespace for the element or types.\[/quote\]I have a class ObjectType which contains properties Name and \[code\]List<SupportedIp>\[/code\]. SupportedIp class contains property Name also. Please refer to my code below:\[code\][XmlRootAttribute("SupportedIp", Namespace = "http://test.com/2010/test", IsNullable = false)]public partial class SupportedIp{[XmlElementAttribute(Namespace = "")] public string Name { get; set; } .... }[GeneratedCodeAttribute("xsd", "2.0.50727.1432")][SerializableAttribute()][DebuggerStepThroughAttribute()][DesignerCategoryAttribute("code")][XmlTypeAttribute(Namespace = "http://test.com/2010/test")][XmlRootAttribute("ObjectType", Namespace = "http://test.com/2010/test", IsNullable = false)]public partial class ObjectType{ /// <remarks/> [XmlElementAttribute(ElementName = "", Namespace = "")] public LocalStrings Name { get; set; } /// <remarks/> [XmlArrayAttribute(ElementName = "Supportedip", Namespace = "")] [XmlArrayItemAttribute(IsNullable = false, Namespace = "")] public List<Supportedip> Supportedip { get; set; }}\[/code\]When application reaches to XmlSerializer part, error displays. Ive seen somewhat related post but there's no concreate answer.Thank you
 
Back
Top