c# - protobuf.net Unexpected subtype -


I'm experiencing this exception in my project using Protobuf.net:

 < Code> invalid operation exception "unexpected sub type: foo"  

I have a class I'm sending that looks like this:

  class Message {list  

Foo has inherited the bar, although the protobuff starts to throttle it and generate the above exception. Is there a way around it? I need to be able to catch all the different subtypes of the bar in the list, so more compelling solutions would be difficult / impossible.

I may be wrong, but I think that you have to specify in the inherited class For example:

  [Serialize, Proto Contract, Proto Include (100, Typef (Foo)) Class Bar {} [Serializable, Proto Contract] Class Foo: Inherit by bar {} / bar  

Comments