How do you share gRPC proto definitions between services : <p>I am specifying a number of independent <strong>gRPC</strong> services that will all be hosted out of the same server process. Each service is defined in its own protobuf file. These are then run through the <strong>gRPC</strong> tools to give me the target language (c# in my case) in which I can then implement my server and client.</p>

<p>Each of those separate APIs uses a number of common elements, things like error response enumerations, the <em>Empty</em> message type (which seems to be available in the <strong>gRPC</strong> <em>WellKnownTypes</em>; but I cannot see how I include that either so I defined my own).</p>

<p>At the moment I end up with each proto building duplicate enums and classes into their own namespace. Though I know I can share the definitions in a common proto file and include that; I do not see how to end up with only a single code gen of these into a common namespace. Though this works it would be neater to keep it to one set; it may also have issues later in conversion and equivalence if doing things like aggregating errors across services.</p>

<p>I assume I am missing something as my reading of things such as the <em>WellKnownTypes</em> namespace suggests that this should be possible but, as mentioned before, I don't see how I refer to that in the Proto either.</p>

<p>SO seems pretty light on <strong>gRPC</strong> for the moment so my searches are not turning up much, and I am new to this so any pointers?</p>
