我已经从这里https://protogen.marcgravell.com/下载了 CLI protogen.exe,并尝试生成一个带有*Specified
可选成员访问器的 C# 文件,如此处所述,使用以下命令行:
protogen --csharp_out="." MyProtoFile.proto +p:detectMissing
所有使用值类型的可选成员都没有可空类型或Specified
访问器。
我也经常收到这个警告信息:
google/protobuf/descriptor.proto(41,1,41,8): warning: no syntax specified; it is strongly recommended to specify 'syntax="proto2";' or 'syntax="proto3";'
而且我不明白,因为我的 proto 文件的第一行是:
syntax="proto2";