AFAIK, protobuf-net does not currently support primitive types as surrogates. It could probably be made to work, but it will take a little time of me looking at it. Options:
- defer on those changes happening, and use primitive surrogate
add pass-thru properties to the code that has
Fixed16
instances, to expose the data asint
, and mark those for serialization - i.e.public Fixed16 Foo {get;set;} [ProtMember(17)] private int FooSerialized { get { return Foo; } set { Foo = value; } }
mark up
Fixed16
to serialize a single internal header, and accept the extra field-header
Note that the first two options should be byte-compatible; the third option has a different layout and is not byte-compatible with the other two.