Protobuf: Status of proto2 in C#?

Created on 13 Jan 2016  路  5Comments  路  Source: protocolbuffers/protobuf

I've noticed that proto2 syntax is disabled in C# codegen. Is it going to be permanently removed or implemented in a later release? Thanks!

c# proto2 question

Most helpful comment

One other software piece that's still stuck on proto2 is ironically Google Chrome.

All 5 comments

We don't have a plan to support proto2 in C# AFAIK.

Our student organization interfaces a robot (running NanoPB) to a C# application. The current NuGet package by Jon Skeet does not support the OneOf option in proto2 whereas NanoPB does not support proto3. So we're stuck in the middle. Could you point me in the right direction to implement proto2 code generation in C# like the rest of the languages?

It would require much more than codegen - the whole runtime library would need to support proto2 as well, including extensions, unknown fields, required/optional etc.

Note that proto2 and proto3 are wire-compatible, so long as you don't start using anything not supported in both. So you could quite possibly have two .proto files, one in proto3 and one in proto2, and generate C# code from the proto3 code and use the proto2 code for the robot. It's not ideal, but it's almost certainly the simplest solution in the short term.

One other software piece that's still stuck on proto2 is ironically Google Chrome.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xfxyjwf picture xfxyjwf  路  35Comments

kolea2 picture kolea2  路  40Comments

tbillington picture tbillington  路  29Comments

blowmage picture blowmage  路  73Comments

laszloagardi picture laszloagardi  路  40Comments