7

According to this post in Microsoft Doc and this warning section:

ASP.NET Core gRPC has extra requirements for being used with Azure App Service or IIS. For more information on where gRPC can be used, see gRPC on .NET supported platforms.

I created an ASP.Net Core gRPC service in .NET 5 with Grpc.AspNetCore(2.34.0) package using above document guidline.

I hosted my service in IIS as for this document

My problem: I get an error in the call RPC method from the Client.

Given Error:

Status(StatusCode="Cancelled", Detail="No grpc-status found on response.")

Additional: I have searched on the web and investigate many issues, But these issues not help me. still, I have this error. I guess have a miss understanding or missed issue about this action.

My primary question: Actually is possible to Hosting ASP.NET Core Grpc Service in IIS at this time.

OS: Windows Server 2019 Version 1809 Build 17763.1697

IIS: Version 10.0.17763.1

Client Code:

    using var channel = GrpcChannel.ForAddress("https://192.168.13.155");
    var client = new ProccessMessage.ProccessMessageClient(channel);
    try
    {
        var result = client.GetMessage(new Request { Name = "Message" });
    }
    catch (RpcException ex)
    {
        string message = ex.Message;
    }

I get this exception: Status(StatusCode="Cancelled", Detail="No grpc-status found on response.") in catch block.

Hasan Fathi
  • 5,610
  • 4
  • 42
  • 60
  • What you posted isn't an exception or error message. How was this generated? If the status is `Cancelled`, has the *client* cancelled the request due to a timeout perhaps? – Panagiotis Kanavos Feb 08 '21 at 11:53
  • Right now, it's impossible to guess what's wrong as there's no client or source code, no error messages, no environment information apart from `ASP.NET Core on Windows Server 2019`. The document you linked to explains that you need Windows Server Build 20241 to deploy to IIS, which was released on [October 2020](https://techcommunity.microsoft.com/t5/windows-server-insiders/announcing-windows-server-preview-build-20241/m-p/1804897) – Panagiotis Kanavos Feb 08 '21 at 11:55
  • @PanagiotisKanavos I edited my question. my client has the basic configurations and no ane extra confoguration – Hasan Fathi Feb 08 '21 at 12:07
  • @PanagiotisKanavos I have added OS and IIS versions to the question. – Hasan Fathi Feb 08 '21 at 12:14
  • The document you linked to explains you need a newer build – Panagiotis Kanavos Feb 08 '21 at 12:16
  • @PanagiotisKanavos That means updating the Windows server version solves the problem? – Hasan Fathi Feb 08 '21 at 12:25
  • 2
    gRPC utilizes newer HTTP2 features like bidirectional streaming - IIS does not support them mainly because HTTP protocol driver in Windows HTTP.sys does not support those advanced features. – hB0 Feb 08 '21 at 15:54
  • "gRPC on .NET supported platforms" - mentions about the upgraded HTTP.sys driver that took place on Windows 10 Build 19529 - is required. Is it also upgraded on Windows Server 2019 some build no? – hB0 Feb 08 '21 at 15:58

1 Answers1

4

Windows Server 2019 - for hosting gRPC with IIS using (in-process) .NET 5 is not yet supported!

Reference: Host grpc service in iis or as an app service

hB0
  • 1,977
  • 1
  • 27
  • 33
  • `ASP.NET Core gRPC Services` Can be hosted in `IIS` from `Windows Server Build 20241` and later. – Hasan Fathi Feb 09 '21 at 12:22
  • 1
    I upgraded My Server `OS` version to this build and my problem is solved. – Hasan Fathi Feb 09 '21 at 12:25
  • 3
    Windows 10 / Windows Server Insider builds are only supported yet, we still await if they will backport these Windows V.Next features to Windows Server 2019 or not, if yes, not sure when. Therefore this feature with Windows and IIS is so far experimental or beta. One can try alternate gRPC Web or ASPNetCore's HTTPSysServer.. For me I do not consider them solutions.. – hB0 Feb 09 '21 at 19:51
  • 2
    It's not a .NET 5 problem - it's HTTP.sys in Windows. Windows 2022 or a preview/insider build should support these trailing headers. – Vince Apr 10 '21 at 01:41