Skip to content

Instantly share code, notes, and snippets.

@anujbhatt
Last active October 8, 2017 21:22
Show Gist options
  • Save anujbhatt/8837506 to your computer and use it in GitHub Desktop.
Save anujbhatt/8837506 to your computer and use it in GitHub Desktop.
Generating C# classes from .proto files on a Mac
$ cat example.proto
message AMessage
{
required int32 a=1;
optional int32 b=2;
}
$ protoc example.proto --descriptor_set_out=example.pb
$ mono ProtoGen.exe example.pb
$ more Example.cs
// Generated by the protocol buffer compiler. DO NOT EDIT!
using pb = global::Google.ProtocolBuffers;
using pbc = global::Google.ProtocolBuffers.Collections;
using pbd = global::Google.ProtocolBuffers.Descriptors;
using scg = global::System.Collections.Generic;
public static partial class Example {
...
...
@MoBo
Copy link

MoBo commented May 12, 2015

Works fine

@rayyee
Copy link

rayyee commented Aug 25, 2015

Where is the ProtoGen.exe?

@icecooly
Copy link

thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment