Serialization of a derived class that hides a base property
I have a class like this
MyClass : BaseClass
string new FirstName
When I try to seriali开发者_如何学Pythonze this class I get the following error message
Member SQLClientAdapter.Columns of type hides base class member Adapter.Columns of type ...Use XmlElementAttribute or XmlAttributeAttribute to specify a new name.
The recomendation did not work.
Google recommended to add the Ignore() attribute to the base class however I'm not able to modify the base class.
Implement ISerializable and do serialization manually or do what the exception message says - rename the property in inherited type in your serialization stream.
精彩评论