开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜