ProtobufGenerator icon indicating copy to clipboard operation
ProtobufGenerator copied to clipboard

Fails with multiple dependent proto files.

Open jasells opened this issue 6 years ago • 3 comments

Protoc can "import" multiple .proto files, such that you can divide up your definition like so: Enum.proto and Messages.proto imports the enums defined in Enums.proto. This tool requires a single .proto file.

jasells avatar Jun 25 '18 15:06 jasells

The protoc docs claims that by default it looks in the directory where protoc is invoked for any imported files. So it SHOULD work in that case (can not test it right now). Imports from a different directory is not supported by this tool, thou it is not very hard to get that to work. There is just a small amount of parsing of the proto file required in order to generate the correct directory parameters for the call to protoc.

halotron avatar Jun 26 '18 07:06 halotron

I get : Error Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) gRpcProto ...Protos\Messages.proto 1

when I add a 2nd .proto that is dependent upon a first. No .cs files are generated for the 2nd .proto.

works fine w/ command line to protoc.exe

jasells avatar Jun 26 '18 13:06 jasells

Ok, thanks. I have updated the readme in the meantime to inform of this until this is fixed.

halotron avatar Jun 27 '18 07:06 halotron