Serializing dynamic type parameter Protobuf-net
问题 Possible duplicates without answers: here and here. I am trying to serialize a class with a params object array using protobuf-net (2.0.0.668). There can be different types in my params object[]. When using DataContractSerializer, simply using [KnownType] works like expected. I understand that it isn't the case for protobuf-net, and that I must use [ProtoInclude] instead, along with DynamicType = true , like so: [ProtoContract, ProtoInclude(20, typeof(Int32))] //Int32 as an example public