C# 如何在protobuf C中序列化没有基类的类#
我有一个扩展DictionaryBase类的类。 使用protobuf序列化此类时,请给出以下异常:C# 如何在protobuf C中序列化没有基类的类#,c#,serialization,protobuf-net,base-class,C#,Serialization,Protobuf Net,Base Class,我有一个扩展DictionaryBase类的类。 使用protobuf序列化此类时,请给出以下异常: Repeated data (a list, collection, etc) has inbuilt behaviour and cannot be subclassed 这是我的代码: [protoContract] public class myClass :DictionaryBase { [protomember(1)] public int temp {get; s
Repeated data (a list, collection, etc) has inbuilt behaviour and cannot be subclassed
这是我的代码:
[protoContract]
public class myClass :DictionaryBase
{
[protomember(1)]
public int temp {get; set;}
}
DictionaryBase类位于系统中。Collenctions
如何不能序列化基类?将
IgnoreListHandling=true
添加到[ProtoContract]
中。然而!这意味着它将忽略字典内容,而只序列化temp
。与protobuf-net类似,类型可以是集合,也可以是叶;决不能两者兼而有之