Protoc C# Google Assistant .proto “Was Not Found O

2019-07-24 21:41发布

问题:

I want to communicate with the Google Assistant SDK using gRPC. I downloaded the embedded_assistant.proto and ran this command in CMD:

protoc -I=I:"\PC Folders\Downloads\proto3.3.0win32\bin" --csharp_out=$DST_DIR "I:\PC Folders\Downloads\proto3.3.0win32\bin\embedded_assistant.proto"

It then gave me these errors:

google/api/annotations.proto: File not found. google/rpc/status.proto: File not found. embedded_assistant.proto: Import "google/api/annotations.proto" was not found or had errors. embedded_assistant.proto: Import "google/rpc/status.proto" was not found or had errors. embedded_assistant.proto:270:5: "google.rpc.Status" is not defined.

How can I fix this? I used this proto compiler: https://github.com/google/protobuf/releases and at the bottom where it says protoc-3.3.0-win32.zip.

回答1:

You can get those file from the googleapis/googleapis repository:

  • google/rpc/status.proto
  • google/api/annotations.proto