Does protobuf-net support nullable types?
问题 Is it possible to generate nullable members in protobuf-net? message ProtoBuf1 { optional Int32? databit = 1; optional Nullable<bool> databool = 2; } 回答1: Yes, but it doesn't generate them by default if you are doing codegen from .proto. If this is just C#, of course, you don't need a .proto - just: [ProtoContract] public class ProgoBuf1 { [ProtoMember(1)] public int? Foo {get;set;} [ProtoMember(2)] public float? Bar {get;set;} } If you are working from .proto, you could consider copying and