Is grpc-web code-first approach will support IIS?

331 Views Asked by At

I created a gRPC service with a code-first approach.

I published my gRPC code to IIS and while consuming in a Blazor client, I was getting "Exception was thrown by handler"

The same code is working fine with localhost.

2

There are 2 best solutions below

0
On BEST ANSWER

According to this GitHub issue, IIS cannot currently host a gRPC service, because HTTP.sys doesn't support trailing headers.

gRPC relies on trailing headers to communicate vital information, like call status.

This issue has mentioned that IIS is supported with .NET 5 and an Insiders Build of Windows.

0
On

As you can see in gRPC services with ASP.NET Core, Microsoft says:

IIS Internet Information Services

(IIS) is a flexible, secure and manageable Web Server for hosting web apps, including ASP.NET Core. .NET 5 and Windows 10 Build 20300.1000 or later are required to host gRPC services with IIS, which may require the use of a Windows Insider build.

IIS must be configured to use TLS and HTTP/2. For more information, see Use ASP.NET Core with HTTP/2 on IIS.

HTTP.sys

HTTP.sys is a web server for ASP.NET Core that only runs on Windows. .NET 5 and Windows 10 Build 19529 or later are required to host gRPC services with HTTP.sys, which may require the use of a Windows Insider build.

HTTP.sys must be configured to use TLS and HTTP/2. For more information, see HTTP.sys web server HTTP/2 support.

And as you know in the current situation, Windows 11 has the 22621.1848 build number, that is higher than Windows 10 Build 20300.1000.

Windows Server 2022 has the 20348.1787 build number, that is higher than Windows 10 Build 20300.1000.

So I think all of them support gRPC, based on the Microsoft documentation.