如何使用protobuf-net处理.proto文件

Que*_*mer 7 c# ruby protocol-buffers protobuf-net

我已经开始使用protobuf-net lib在我正在维护的一些程序之间进行通信.我也能够将C#中的消息解码为Ruby.我的ruby ProtoBuf lib使用.proto文件生成ruby代码.为了不得不在尽可能少的地方进行更改,我希望protobuf-net使用相同的.proto文件.虽然看起来protobuf-net文件夹有一个名为ProtoBufGenerator和protobuf exe的Dll,但我无法找到任何关于我是否可以通过这种方式使protobuf-net工作的指令.

这可能吗?

Tho*_*rin 5

查看Marc Gravell的博客,特别是这篇文章.您基本上将其设置为Visual Studio中文件的自定义构建工具.

  • @JustSmith(和@Thorarin) - 只是为了完整性,还有一个命令行工具`protogen.exe`. (2认同)