2
我是新來使用protobuf並有一個問題,試圖序列化從Dictionary繼承的類。其他屬性未被序列化。 作爲examle我有這個類使用protobuf網與DictionaryBase
[ProtoContract]
public class InheritDictionary: Dictionary<string,string>
{
private int _myInt;
[ProtoMember(1)]
public int MyInt
{
get
{
return _myInt;
}
set
{
_myInt = value;
}
}
}
當我序列不包含敏屬性。 我錯過了什麼嗎?
謝謝馬克,我認爲這就是我必須要做的。很高興得到確認你沒有做錯什麼。 –