According to this post (from March), protobuf v2 allows us to resolve types from a stream. Since v2 is now in beta 5, I think this feature has already been implemented, so I was wondering how to use this new feature. I haven't been able to find any documentation on it, so some help would be greatly appreciated !
Type meta
The serialization is fine, but I don’t know (and cannot know) all of my types up front. How can I do this?
Well, protobuf is a contract based format; if you don’t know the types, it will struggle – as will any contract based serializer…
Yes, I get that; now: how do I do it?
Now, I’ve held off putting any meta in the stream for various reasons:
it steps far outside the core protobuf spec it flashes the warning signs of BinaryFormatter, my nemesis But, so many people seem to want this that I think I have to buckle; but on my terms! So in v2, I’m adding the ability to indicate that (on a per-member basis) objects should resolve their type information from the stream. By default, by embedding the assembly-qualified-name, but providing an abstraction layer over that allowing you to provide your own string<===>Type map (and thus avoiding the knots in by stomach caused by too much type dependency).