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
The name 'GrpcClient' does not exist in the current context GrpcGreeterClient #14170
Comments
As work around suggested RobinKetting fixed the issue for now. Had to uninstall the current Grpc.Net.Client package and issue the following command in the PMC "Install-Package Grpc.Net.Client -version 0.1.22-pre2" |
I just ran into the same problem. Make sure Grpc.AspNetCore is only installed on the Server project. If it is installed across the whole solution then it conflicts with Grpc.Net.Client on the Client project and prevents the Client project from installing correctly. |
@Rick-Anderson why is this issue closed ?! I have similar problem and installing earlier version of grpc client actually makes it worse cause now the GrpcChannel namespace is missing. |
@ihorbond the cause of the problem and solution are in this issue. |
I ran into the same problem. After inspect the GrpcGreeterClient.csproj, I found a strange node as follows:
After delete it, rebuild the project, the problem is gone. |
To anyone that might still have the above mentioned problem, make 100% sure that your PMC "Default Project" setting is set to GrpcGreeterClient when issuing the following commands: Install-Package Grpc.Net.Client If not, you will have the aforementioned problem. I just figured it out today that I was doing something that dumb and wondering why the GrpcClient was not being created. Hope this helps. Chris |
in my file GrpcGreeterClient.csproj delete this part
compile and then add the line again, and it worked without issue |
the solution from Jezuz85, works perfectly on my end. Thank you so much! |
@JamesNK should I mention this in the tutorial? @wadepickett on testing did you see this? |
Removing and adding the same text from a csproj shouldn't have any impact. I'm not sure what the issue is that people are encountering. |
@Rick-Anderson, I think you are referring to the test I did for #21657. (Sorry just saw your question from 4 hours ago) It looked like there was issue around renaming the namespace in the greet.proto to "GrpcGreeterClient" which was fixed in the doc instructions but was not updated in the current client downloadable sample: The namespace inside the greet.proto file for the client sample project's namespace should be: |
Fix #21732 |
How to solve :
|
The problem, for me, was the csproj.
Just replaced the "Server" for "Client" and all worked just fine.
|
After pasting the code into program.cs in the Greeter client project I get compiler error "The name 'GrpcClient' does not exist in the current context GrpcGreeterClient". I think that this is because no classes are generated by the build process after adding the item group to the project file. No idea why, the project file was edited correctly.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: