Protobuf doesn't directly support deserialization like this. You could use JsonFormatter <https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/json-formatter> to convert to JSON and deserialize from there. Your best option is probably to look into third party libraries that provide deserialization functionality for protobufs.
On Friday, April 15, 2022 at 7:13:32 AM UTC-7 [email protected] wrote: > I am looking for a way to deserialize a binary protobuf message using > a .proto schema provided at runtime. Ideally that would deserialize to some > dynamic object or a wrapper which can be used to query for property names > and values. Is this a supported scenario? > > So I guess the process will involve those steps: > > 1. Compile the .proto text schema to its binary representation > 2. Feed the binary schema along with the protobuf binary message to > some parser/deserializer > > My ultimate goal is to provide the same functionality in C# as the "protoc > —decode" command - a human readable representation of the message. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/4c4752a5-373e-4c39-8d0f-8aabab5989f1n%40googlegroups.com.
