I’ve got a 3 level inheritance graph.
ProtoBuf 2.0.0.611
QueryRequest
VenueQueryRequest
VenueQueryRequestV1
All marked with
[DataContract, System.Serializable, ProtoBuf.ProtoContract]
QueryRequest includes:
[ProtoInclude(10, typeof(VenueQueryRequest))]
[ProtoInclude(11, typeof(VenueQueryRequestV1))]
When I call SerializeWithLengthPrefix for a VenueQueryRequestV1 I get “Unknown sub-type: VenueQueryRequestV1”
If I ADD (not replace) before making any calls
RuntimeTypeModel.Default[typeof(QueryRequest)].AddSubType(10, typeof(VenueQueryRequest));
RuntimeTypeModel.Default[typeof(QueryRequest)].AddSubType(11, typeof(VenueQueryRequestV1));
I get “Duplicate field-number detected; 10 on: Designertech.AzureServices.Messages.QueryRequest”
If I only add the second one, I get the same error, but with 11 instead of 10.
If I replace, I get the original error
Which makes it look to me like it should know about the sub-type
Am I potentially messing things up with a cast or something somewhere?
At the moment, only the base class has any properties declared on it.
[ProtoMember(1)]
IList<string> RequestedFields
This is driving me nuts.
As an aside, this is being used to produce messages to be fed into the CloudFX Azure Service Bus framework.
Each level only needs to notify the direct sub-types: