Environmental description
- .net core 3.1, refer to the configuration of Microsoft’s official website
- Microsoft’s project code address
Error content
Grpc.Core.RpcException:“Status(StatusCode=Internal, Detail="Error starting gRPC call: An error occurred while sending the request.")”
Solution
Problem solving instructions 1
Problem solving instructions 2
Add the AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
client code before the client grpc request as follows
static async Task Main(string[] args)
{
// The port number(5001) must match the port of the gRPC server.
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
using var channel = GrpcChannel.ForAddress("http://localhost:5001");
var client = new Greeter.GreeterClient(channel);
var reply = await client.SayHelloAsync(
new HelloRequest { Name = "GreeterClient" });
Console.WriteLine("Greeting: " + reply.Message);
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
Suggestion: go directly.NET 5
Similar Posts:
- [Solved] Nginx 502Bad Gateway: some static resources cannot be accessed
- PXE install windows System Error: pxe-e55:ProxyDhcp service did not reply to request on port 4011
- How to deal with the exception of database connection pool in Python flash
- [Solved] Axios Cross-domain issues: No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.
- Problems of entering extended passive mode encountered in FTP [How to Solve]
- Rabbitmq simple configuration and oserror: [errno 9] bad file descriptor problem
- Programming udp sockets in python
- Rocketmq Error: connect to IP: 10909 failed [How to Solve]
- How to find Oracle EBS Weblogic Server Admin Port and URL