I'm trying to get Microsoft's gRPC "Greeter" application to work on my business laptop, but I keep getting the following exception when invoking the gRPC call:
Grpc.Core.RpcException: 'Status(StatusCode=Internal, Detail="Error starting gRPC call: No such host is known.")'
This is the documentation from Microsoft, which I followed. The exact code I'm running comes from Microsoft's samples and can be found on their github here.
It literally boils down to starting the most basic gRPC server and then invoking the call via
using var channel = GrpcChannel.ForAddress("https://localhost:5001");
var client = new Greeter.GreeterClient(channel);
var reply = await client.SayHelloAsync(new HelloRequest { Name = "GreeterClient" });
The call to SayHelloAsync is the one that throws the exception.
The exact same code on my home machine works fine.
I've already checked my /etc/hosts file for weird entries, but nothing.
I've also tried changing https://localhost:5001 to https://[::1]:5001 and https://127.0.0.1:5001, same exception, which I find incredibly weird.
I've also already tried http via AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); and calling the http endpoint, same exception.