Paul Krill
Editor at Large

Microsoft brings gRPC-Web support to .NET

news
Feb 4, 20202 mins

Experimental support allows ASP.NET Core gRPC apps and .NET Core gRPC clients to call gRPC services directly

colorful network wires tied in a knot
Credit: Thinkstock

Microsoft has rolled out experimental support for gRPC-Web in .NET Core and ASP.NET Core, allowing gRPC-Web to be called directly from the .NET Core gRPC client and ASP.NET Core gRPC apps.

Compatible with HTTP/1 and HTTP/2, gRPC-Web is a JavaScript client library supporting the same API as gRPC-Node to access a gRPC service, with gRPC serving as an open source RPC framework enabling client and server applications to transparently communicate.

With gRPC-Web for .NET, Microsoft expects to bring the following capabilities to browser apps:

  • Server streaming
  • Compact Protobuf messages
  • Strongly typed, code-generated clients

The experimental package lets an ASP.NET Core app support gRPC-Web without a proxy and allows the .NET Core gRPC client to call gRPC Web services, which is useful for Blazor WebAssembly apps. Aside from calling ASP.NET Core gRPC apps from the browser, opportunities for gRPC-Web include:

  • Calling gRPC from platforms such as Blazor WebAssembly and Xamarin.
  • Hosting ASP.NET Core gRPC apps in Azure App Services and IIS.

With gRPC-Web, there is a stable client gRPC-Web JavaScript client and a proxy for translating between gRPC and gRPC-Web for services. Microsoft noted there is a small performance cost to gRPC-Web and that two gRPC features—client streaming and bidirectional streaming—are no longer supported.

To get started with gRPC in .NET, Microsoft has published a tutorial on creating a gRPC client and server in ASP.NET Core. With gRPC-Web, no changes are required to services, only the startup configuration is modified. The gRPC GitHub repo provides instructions for setting up a gRPC-Web client for JavaScript SPAs.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author