Ivan
Ivan

Reputation: 7746

Protocol Buffers under Windows C++ .Net

I have gotten google protocol buffers to work with Linux as the server, and C#.Net under windows as the client. However, I don't see a way to generate C++.net. Can someone point me to how I can do that?

Thanks.

Ivan

Upvotes: 2

Views: 165

Answers (1)

Marc Gravell
Marc Gravell

Reputation: 1062502

I'm not aware of a full C++ .NET implementation, and none is listed in the 3rd party add-ons, so I think you have a few options:

  • use the unmanaged C++ implementation (presumably the google version), and map between your unmanaged and managed types manually
  • use one of the C# implementations (protobuf-net or protobuf-csharp-port would be my preferences, depending on whether you want idiomatic .NET versus idiomatic protobuf), and compile this as a C# library, and simply reference the C# library from you C++ .NET project
  • write (and ideally contribute) a C++ .NET translator to your implementation of choice (since you have tagged protobuf-net, I will make the observation that this means writing an xslt file for protobuf-net)

If you want the most pragmatic C++ option, I'd choose the first. If you want the most pragmatic .NET option, I'd choose the second. If you demand a proper C++ .NET file that you can include in your existing project, I'd choose the third.

Upvotes: 3

Related Questions