0

I'm trying to do gRpc Transcoding with .NET 7. I'm following the article Here. I'm also referring to the sample implementation here. After I added the proto files annotation.proto and http.proto and include the annotations.proto to the main proto file. I get the error

Rebuild started...

1>------ Rebuild All started: Project: CacheService, Configuration: Debug Any CPU ------

Restored C:\CarryCase\Venkatesh\M2c\grpc\net7\CacheService\CacheService.csproj (in 40 ms).

1>google/api/annotations.proto : error : File not found.

1>Protos/cache.proto(2,1): error : Import "google/api/annotations.proto" was not found or had errors.

1>Done building project "CacheService.csproj" -- FAILED.

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

========== Elapsed 00:00.428 ==========

The code for the same is available at here (grpc-transcoding)

I tried to create a gRPC transcoding code with .NET 7. But the proto definitions are not getting properly included resulting in error. I would expect it to work as told in reference articles

Venkatesh
  • 320
  • 2
  • 18
  • Did you follow "Usage" step 3 in that article? `Add google/api/http.proto and google/api/annotations.proto files to the project.` – Doug Fawley Nov 30 '22 at 22:11
  • Yes I have done that. You can see the code in the above link – Venkatesh Dec 01 '22 at 02:52
  • The error complains very directly about not being able to find the file. Maybe you need to pass a path to the `protoc` binary to point to it (`-I`, possibly). – Doug Fawley Dec 01 '22 at 23:09

1 Answers1

0

Answering my own question here. I had worked with grpc-dotnet team. Detailed solutions is at (https://github.com/grpc/grpc-dotnet/issues/1965). My proto files are in folder structure enter image description here

With this structure in cache.protos we need to use Protos/google/api/annotations.proto and in annotations.proto we need to use Protos/google/api/http.proto. Also there was a message CustomHttpPattern missing that I added from the appropriate repo. The completed solution is available on my public github repo https://github.com/VenkateshSrini/GRpcFileCache/tree/gRpc-transcoding

Venkatesh
  • 320
  • 2
  • 18