What is the property? A sub-object? A List? If the serializer doesn't think it needs to call the setter: it won't. For example, the typical list handling code could be paraphrased (not the actual implementation) as:
var list = obj.SomeList;
bool setValue = false;
if(list == null) {
list = new List<SomeType>();
setValue = true;
}
while(nextTag == expected) {
list.Add(ReadSomeType());
}
if(setValue) obj.SomeList = list;
Indeed, it is not uncommon that there *is no setter* (for a list / child object), so the library needs to support those scenarios too.
There are some flags you can set to help steer it to always write - but an example of your scenario would help.
Also, note that the library supports deserialization callbacks (to perform any pre-deserialization steps), custom type factories (to initialize objects in a different way) and constructor-skipping (to bypass any fields initializers) - these are all optional switches etc.
Marc
I know this is a long shot, but is there any reason protobuf-net would call the getter of a property on deserialization, and not the setter? Most of my properties serialize and deserialize fine, but for one particular property only the getter is called, and thus deserialization fails.
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.
Yes, OverwriteList should fix this. IgnoreListHandling does something very different that doesn't apply here (see the intellisense comments for full usage
Marc
--