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.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
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"
@VinceJSV thanks for the update. When ASP.NET Core 3.0 GA's, this shouldn't be a problem.
@JamesNK - do we need to add a note for this problem or is the issue discoverable enough?
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.
@ihorbond
I ran into the same problem.
After inspect the GrpcGreeterClient.csproj, I found a strange node as follows:
<ItemGroup>
<Protobuf Include="Protos\greet.proto" GrpcServices="Server" />
</ItemGroup>
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
Install-Package Google.Protobuf
Install-Package Grpc.Tools
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