public object foo {get, set}
and an object B that inherits from A and hides the property:
public new int foo {get, set}
When I try to serialize object B with XML serialization, I get this:
"Member B.foo of type System.Int32 hides base class member A.foo of type
System.Object. Use XmlElementAttribute or XmlAttributeAttribute to specify a
new name."
What should I do here? I've put an XMLElement attribute on B.foo so that
it's named something different but that doesn't help. Any ideas?
This behavior is by design currently: because you are changing the type on
the property we cannot express this in xsd (we do not support restriction
in this version). The error message is misleading as applying the proposed
change will not fix the problem.
To express this in an XSD schema without breaking the inheritance chain we
would have to first restrict the base type to forbid the use of the object
type, and then extend the resulting type with new int foo element.
Thanks
Karthik
This posting is provided "AS IS" with no warranties.