Grpc.AspNetCore.Server 2.49.0

Grpc.AspNetCore.Server

Grpc.AspNetCore.Server is a gRPC server library for .NET.

Configure gRPC

In Startup.cs:

  • gRPC is enabled with the AddGrpc method.
  • Each gRPC service is added to the routing pipeline through the MapGrpcService method. For information about how to create gRPC services, see Create gRPC services and methods.
public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddGrpc();
    }

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }

        app.UseRouting();

        app.UseEndpoints(endpoints =>
        {
            endpoints.MapGrpcService<GreeterService>();
        });
    }
}

ASP.NET Core middleware and features share the routing pipeline, therefore an app can be configured to serve additional request handlers. The additional request handlers, such as MVC controllers, work in parallel with the configured gRPC services.

Showing the top 20 packages that depend on Grpc.AspNetCore.Server.

Packages Downloads
Grpc.AspNetCore.Server.ClientFactory
HttpClientFactory integration the for gRPC .NET client when running in ASP.NET Core
5
Grpc.AspNetCore.Server.ClientFactory
HttpClientFactory integration the for gRPC .NET client when running in ASP.NET Core
8
Grpc.AspNetCore.Server.ClientFactory
HttpClientFactory integration the for gRPC .NET client when running in ASP.NET Core
501
Grpc.AspNetCore.Server.Reflection
Automatic discovery of services for Grpc.Reflection
324
Sentry.AspNetCore.Grpc
Official ASP.NET Core gRPC integration for Sentry - Open-source error tracking that helps developers monitor and fix crashes in real time.
299

.NET Core 3.0

.NET 5.0

.NET 6.0

.NET 7.0

Version Downloads Last updated
2.49.0 506 11/14/2022
2.40.0 306 10/17/2022
2.39.0 317 11/25/2022