简体   繁体   中英

C# code generation with Google Protobuf proto2 files

I have several .proto files with proto2 syntax. I am trying to auto-generate C# classes using the protoc compiler but I get the error: "C# code generation only supports proto3 syntax.

Other than manually updating each .proto file to conform to proto3 syntax, is there no other way to auto generate C# classes? I'm completely new to protobuf so I know this may sound like a weird question given that the compiler clearly states that I have to follow proto3 syntax - I'm just wondering if there was ever a workaround to getting C# classes to work with proto2 syntax.

您可以使用protobuf-net 1.0.0.280包中的古老/古老的protogen.exe来完成这个技巧,或者稍微更现代,但仍然不再维护protobuf-csharp-port项目。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM