-
Notifications
You must be signed in to change notification settings - Fork 36
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
Missing "google/protobuf/descriptor.proto". #4
Comments
Hi Could you please share the command that you are trying to run? What version of protoc are you using?
Note that I'm using protobuf 3.7 and grpc 1.25.0 from Homebrew on Mac OS. Moreover, @mmarinchenko shared working configuration for C# projects: #1 (comment) |
I'm using nuget packages: 'Google.Protobuf 3.11.1', 'Grpc 2.25.0', 'Grpc.Net.Client' and 'Grpc.Tools', like in this video: https://www.youtube.com/watch?v=QyxCX2GYHxk For every proto-file, I'm setting 'Protobuf compiler' in build Actions. |
Hi @BVIVal! You do not need to download or copy I'll try to help you if you attach your csproj file which I may use to reproduce your problem (I have no will to watch 1 hour video trying to understand what exactly you are doing :) ). |
BTW, you have 2 unused includes in YC API:
|
Do you plan to add tags representing api version to repository? |
Thank you @mmarinchenko ! The code of *.csproj-file: |
I downloaded your file and make the following changes. 1. I have only VS 2017, so I changed target framework from 2. You have 2 protos in the project file which are not from this repository, so I commented them out too:
After that I tried to build the project and it failed with the following errors:
While compiling To solve this particular error you may specify
But if you do this then the yandex protos will not compile:
And vice versa. This is exactly the issue #1 which I reported earlier: yandex protos and google protos are located in different directories but So first of all I recommend you to carefully read the official documentation of 1. Copy google protos from
2. Call protoc directly. The protoc itself allows to specify many include paths (check the command used by @MAnyKey above). This can be achieved in project configuration using MSBuild target:
I chose first option for myself, so I cannot guarantee that the second one will work. I wrote some MSBuild magic to copy all protos to temporary Another issue of Good luck! |
I found a solution here - https://github.com/mifopen/YandexCloudDotNet
|
I finalized the project using the DisableProtobufDesignTimeBuild property and the code from the posts above. This project does not produce errors during the first build (if there is already code that uses some services). Maybe this will help someone End Code(Updated)
|
https://github.com/grpc/grpc/search?q=ProtoRoot&unscoped_q=ProtoRoot |
Another thanks, @HavenDV! I'll try your approach in my project next week and share my experience. |
I've tested You may find updated version of my sample at issue #1's new comment. Feel free to use it as you wish. Your project from the comment above has several issues.
|
@mmarinchenko,
so the dependency is available only to this project
|
@HavenDV, thanks for the info.
|
Hi!
I've faced with the problem of compiling 'annotations.proto'-file. It requires an import of "google/protobuf/descriptor.proto" that was not in the repository.
On official repository of 'Protobuf', I've found missing import-file, by the link:
https://github.com/protocolbuffers/protobuf/releases/download/v3.11.1/protobuf-csharp-3.11.1.tar.gz
And, after unzipping, go to 'protobuf-3.11.1\src\google\protobuf\descriptor.proto' and faced another problem - it uses syntax of proto2.
Here is the question:
How did you solve this issue? Please, tell me, I've stuck with my project for 2 days...
By my little experience, gRPC in C# only works with proto3:(
The text was updated successfully, but these errors were encountered: