Open GoogleCodeExporter opened 9 years ago
This is due to a subtle difference in the processing of default values, and how
protobuf-net decides whether or not to include a value. In this case, the
simplest behaviour is to ask it to always include `ValueBool` explicitly:
[ProtoMember(2, IsRequired = true)]
(in 2 places, IIRC)
There are a number of ways of deciding the conditional serialization rules in
protobuf-net, including:
- Nullable<bool>
- ShouldSerialize{PropertyName} (pattern from XmlSerializer and ComponentModel)
- {PropertyName}Specified (pattern from XmlSerializer)
it can *also* be influenced by [DefaultValue(...)], and in v2 the implicit
defaults can be disabled if desired.
But: adding IsRequired fixes it in your example.
Original comment by marc.gravell
on 7 Dec 2011 at 3:50
Original issue reported on code.google.com by
kris.van...@Avalon-automation.be
on 7 Dec 2011 at 8:46Attachments: