如何将 protogen 与 protobuf-net v2 beta 一起使用?
我注意到 v2 beta 的下载不包含 protogen,这是因为现有的 protogen 生成的类可以正常工作吗?
I notice that the download for v2 beta does not include protogen, is this because the existing protogen-generated classes just work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很大程度上,这只是测试版的验证/时间安排问题。在代码生成区域中还记录了一些我想要解决的调整,我计划很快解决。
然而,我没有包含它有一个功能原因:默认情况下(IIRC)它包含使用未知字段 API(扩展字段)的往返安全对象。此功能不在当前的测试版本中(没有它您也可以做很多事情)。
如果您不请求往返安全对象,则现有的 protogen 应该发出与 v2 兼容的 C#(为了兼容性和方便性,保留整个 v1 API)。
Largely this simply a matter of validation / timing with the beta. There are also a number of tweaks logged in the code-gen area that I want to address, which I plan to address shortly.
However, there is a functional reason I haven't included it: by default (IIRC) it includes round-trip safe objects, using the unknown-fields API (extension fields). This feature is not in the current beta drop (you can do a vast amount without it).
If you don't request round-trip safe objects, the existing protogen should emit C# that is compatible with v2 (the entire v1 API is retained for both compatibility and convenience).