开发者

Serialization of a derived class that hides a base property

开发者 https://www.devze.com 2022-12-09 01:12 出处:网络
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

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

精彩评论

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