gRPC problem with Windows 11 and IIS: Grpc.Core.RpcException: 'Status(StatusCode="Internal", Detail="Failed to deserialize response message.")
I am trying to host my gRPC service in IIS.
But i get this error.
"Grpc.Core.RpcException: 'Status(StatusCode="Internal", Detail="Failed to deserialize response message.")'"
When I run my gRPC service (debug->start without debugging) it works fine.
I reproduced the problem with te greeter service example.
This is the proto file (client and server):
syntax = "proto3";
option csharp_namespace = "GrpcServiceSimpel";
package greet;
service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply);
}
message HelloRequest {
string name = 1;
}
message HelloReply {
string message = 1;
}
This is the client code (console application).
using Grpc.Net.Client;
using GrpcServiceSImpel;
using var channel = GrpcChannel.ForAddress("https://grpctest.dealerportal.nl/");
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();
The IIS logging shows this:
#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2022-10-03 12:16:20
#Fields: date time s-sitename s-computername s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs-version cs(User-Agent) cs(Cookie) cs(Referer) cs-host sc-status sc-substatus sc-win32-status sc-bytes cs-bytes time-taken
2022-10-03 12:16:20 W3SVC18 DA-NB30 127.0.0.1 POST /greet.Greeter/SayHello - 443 - 127.0.0.1 HTTP/2 grpc-dotnet/2.49.0+(.NET+6.0.9;+CLR+6.0.9;+net6.0;+windows;+x64) - - grpctest.dealerportal.nl 200 0 0 0 342 2842
I am running windows 11, I tried build 22000 and 22622