0
votes

.NET Core gRPC-Web client calling ASP.NET Core gRPC-Web server on http://localhost:5000 works fine.

Same client code calling server deployed to an IIS server with a virtual application (e.g., "http://build.mycompany.ca/myapp") results in

Status(StatusCode="Unimplemented", Detail="Bad gRPC response. HTTP status code: 404")

My ASP.NET Core 3.1 server is set up correctly. i.e., app.UseGrpcWeb(new GrpcWebOptions { DefaultEnabled = true });

is in between

app.UseRouting()

and

app.UseEndpoints(endpoints => {
    endpoints.MapControllers();
    endpoints
        .MapGrpcService<GrpcClientService>()
        .EnableGrpcWeb();
});

Any ideas what I'm missing here?

1

1 Answers

0
votes

only the host portion of the URI is used in the Grpc client. A DelegatingHandler is required to redirect to a subdirectory on the target host.

https://github.com/grpc/grpc-dotnet/issues/880