Can client NuGet package Grpc (netstandard 2.0) communicate with Grpc.Asp.NetCore server (.NET 5.0) and how?

I was unable to set them to communicate and I can't find any documentation about them except examples that don't show all that is possible and do not go into details.

I get this error: Grpc.Core.RpcException: 'Status(StatusCode="Unavailable", Detail="failed to connect to all addresses", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1606022572.153000000","description":"Failed to pick subchannel","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x86\src\core\ext\filters\client_channel\client_channel.cc","file_line":4166,"referenced_errors":[{"created":"@1606022572.153000000","description":"failed to connect to all addresses","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x86\src\core\ext\filters\client_channel\lb_policy\pick_first\pick_first.cc","file_line":398,"grpc_status":14}]}")'

Server project .NET 5.0

Client netstandard2.0:

public static class Class1
{

    public static string Test()
    {
        //using var channel = GrpcChannel.ForAddress("https://localhost:5001");
        //var client = new Greeter.GreeterClient(channel);

        //var reply = await client.SayHelloAsync(new HelloRequest { Name = "GreeterClient" });


        Channel channel = new Channel("127.0.0.1:5001", ChannelCredentials.Insecure);

        var client = new Greeter.GreeterClient(channel);
        String user = "you";

        var reply = client.SayHello(new HelloRequest { Name = user });
        return reply.Message;
    }
}

It's a Greeter example project from https://github.com/grpc/grpc-dotnet/tree/master/examples/Greeter with added client netstandard2.0 project that references this gRPC: https://github.com/grpc/grpc I have another .NET framework 4.8 project that references client netstandard2.0 so that it could try to communicate with grpc-dotnet.

Channel channel = new Channel("127.0.0.1:5001", ChannelCredentials.Insecure); ... I've also tried with a certificate



Read more here: https://stackoverflow.com/questions/64950996/can-client-nuget-package-grpc-netstandard-2-0-communicate-with-grpc-asp-netcor

Content Attribution

This content was originally published by Hrvoje at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: