Grpc.AspNetCore.Web
2.83.0
Prefix Reserved
dotnet add package Grpc.AspNetCore.Web --version 2.83.0
NuGet\Install-Package Grpc.AspNetCore.Web -Version 2.83.0
<PackageReference Include="Grpc.AspNetCore.Web" Version="2.83.0" />
<PackageVersion Include="Grpc.AspNetCore.Web" Version="2.83.0" />
<PackageReference Include="Grpc.AspNetCore.Web" />
paket add Grpc.AspNetCore.Web --version 2.83.0
#r "nuget: Grpc.AspNetCore.Web, 2.83.0"
#:package Grpc.AspNetCore.Web@2.83.0
#addin nuget:?package=Grpc.AspNetCore.Web&version=2.83.0
#tool nuget:?package=Grpc.AspNetCore.Web&version=2.83.0
Grpc.AspNetCore.Web
Grpc.AspNetCore.Web provides middleware that enables ASP.NET Core gRPC services to accept gRPC-Web calls.
Configure gRPC-Web
In Program.cs:
using GrpcGreeter.Services;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddGrpc();
var app = builder.Build();
// Configure the HTTP request pipeline.
app.UseRouting();
app.UseGrpcWeb(new GrpcWebOptions { DefaultEnabled = true });
app.MapGrpcService<GreeterService>();
app.Run();
gRPC-Web can be enabled for all gRPC services by setting GrpcWebOptions.DefaultEnabled = true, or enabled on individual services with EnableGrpcWeb():
app.MapGrpcService<GreeterService>().EnableGrpcWeb();
gRPC-Web and streaming
Traditional gRPC over HTTP/2 supports streaming in all directions. gRPC-Web offers limited support for streaming:
- gRPC-Web browser clients don't support calling client streaming and bidirectional streaming methods.
- gRPC-Web .NET clients don't support calling client streaming and bidirectional streaming methods over HTTP/1.1.
- ASP.NET Core gRPC services hosted on Azure App Service and IIS don't support bidirectional streaming.
When using gRPC-Web, we only recommend the use of unary methods and server streaming methods.
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (34)
Showing the top 5 NuGet packages that depend on Grpc.AspNetCore.Web:
| Package | Downloads |
|---|---|
|
Sitko.Core.Grpc.Server
Sitko.Core is a set of libraries to help build .NET Core applications fast |
|
|
DH.Grpc
DH框架Grpc扩展类 |
|
|
Ivy
Build Internal Applications with AI and Pure C# |
|
|
Girvs.WebFrameWork
Package Description |
|
|
GamesCheetah.RealtimeEmbeddedServer
Package Description |
GitHub repositories (19)
Showing the top 19 popular GitHub repositories that depend on Grpc.AspNetCore.Web:
| Repository | Stars |
|---|---|
|
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
|
|
|
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
|
|