Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grpc.JsonTranscoding requires manually copying annotations.proto and http.proto into projects #43376

Closed
1 task done
rars opened this issue Aug 18, 2022 · 2 comments · Fixed by #44999
Closed
1 task done
Labels
area-grpc Includes: GRPC wire-up, templates

Comments

@rars
Copy link

rars commented Aug 18, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

When using AspNetCore.Grpc.JsonTranscoding I have to manually copy Google API annotations.proto and http.proto into my projects so that they can e.g. import "google/api/annotations.proto";.

Describe the solution you'd like

A NuGet package that I can reference that contains the correct version of these files compatible with the version of AspNetCore.Grpc.JsonTranscoding I'm using and will make these files available in the build process so that e.g. import "google/api/annotations.proto"; works.

Additional context

An alternative solution might be to contain these files in another existing package e.g. discussed in grpc/grpc#18214. Maybe the landscape has changed and they would reconsider including in Grpc.Tools.

I've made a suggestion as to how this might be achieved in grpc/grpc-dotnet#167 (comment). Example here: https://github.com/rars/JsonTranscodingDemo
This uses GeneratePathProperty="true" on the PackageReference and then AdditionalImportDirs="$(PkgJsonTranscoding_Protos)\content" on the relevant Protobuf elements that need to import google/api/annotations.proto.

Thanks.

@Tratcher Tratcher added the area-grpc Includes: GRPC wire-up, templates label Aug 18, 2022
@halter73 halter73 added this to the .NET 8 Planning milestone Aug 23, 2022
@halter73
Copy link
Member

Triage decision:

This looks like something we should consider for .NET 8.

@JamesNK
Copy link
Member

JamesNK commented Nov 11, 2022

I think I found a way to make this idea work without the developer having to do anything by including some msbuild with the package. No need to add GeneratePathProperty="true" or AdditionalImportDirs="$(PkgJsonTranscoding_Protos)\content" to csproj.

See #44999

@ghost ghost locked as resolved and limited conversation to collaborators Dec 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-grpc Includes: GRPC wire-up, templates
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants