Invoke .NET Core 3.1 gRPC service from .NET 4.8 client

135 views
Skip to first unread message

Christian Havel

unread,
Mar 22, 2021, 9:23:50 AM3/22/21
to grpc.io
Hi,

I started to play around with gRPC. I have a very simple gRPC service in .NET Core 3.1.
Then I wrote a .NET Core 3.1 client. Both applications are running on the same machine.
Everything works fine.

Now I try to connect my gRPC server from a .NET Framework 4.8 client (Windows Forms), that fails with the following exception:
grpcerror.PNG

I create the channel on the client like this:
var channel = new Channel($"http://{ip}:{Port}", ChannelCredentials.Insecure);
 _serviceClient = new BridgeService.BridgeServiceClient(channel);
var request = new HelloRequest {Name = "Franz"};
var reply = _serviceClient.SayHello(request);

This is the server side:
var credentials = ServerCredentials.Insecure;
var hostName = Dns.GetHostName();
 _port = new ServerPort(hostName, Port, credentials);
_rpcServer = new Server
{
                Services = {BridgeService.BindService(new BridgeServiceImpl())},
                Ports = { _port }
 };
_rpcServer.Start();

Any idea what is missing?
Thanks,
Christian





Christian Havel

unread,
Mar 22, 2021, 10:23:06 AM3/22/21
to grpc.io
Hi,
I would like to add the information, that the gRPC server is a console application, not a ASP.NET Core application.
Christian

Jan Tattermusch

unread,
Apr 8, 2021, 7:15:33 AM4/8/21
to grpc.io
I'd try to specify the channel target as "a.b.c.d:3280" without the "http://" prefix. From the error it looks like the URL is being interpreted as a DNS name (rather than an IP).
Reply all
Reply to author
Forward
0 new messages