I'm working with protobuf-net v2 r480 (to the best of my understanding...).
Question:
How can I get protobuf-net to ignore list handling when the class with the list handling (FileTree
) is a field of another class (MyRandomStuff
)?
Background:
I have a FileTree class (which I previously described here on StackOverflow) which implements ICollection<MyFileInfo>
, IEnumerable<MyFileInfo>
, IEnumerable
, and a few other interfaces. I have tagged the FileTree
class with [ProtoContract(IgnoreListHandling = true)]
. The FileTree
class itself serializes beautifully.
The problem I am having is with MyRandomStuff
class, which has a FileTree
field. When I tag that field with "[ProtoIgnore]
", the instance of MyRandomStuff
serializes just fine. However, when I include the FileTree
field via "[ProtoMember(2)]
", serialization fails with a message that the MyFileInfo
object needs to have a parameterless constructor. I have intentionally setup my code so that MyFileInfo
is never serializable. (Instead, FileTree
creates the relevant MyFileInfo
objects during deserialization).
Unfortunately, I don't have a quick sample that I can send if it is a bug. I have a work-around already, but I thought maybe I'd ask here if I'm just doing something incorrectly (like tagging, or using an out-of-date version of protobuf).