Grpc.AspNetCore.Server 2.50.0

.NET 5.0 .NET Core 3.0
dotnet add package Grpc.AspNetCore.Server --version 2.50.0
NuGet\Install-Package Grpc.AspNetCore.Server -Version 2.50.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Grpc.AspNetCore.Server" Version="2.50.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Grpc.AspNetCore.Server --version 2.50.0
#r "nuget: Grpc.AspNetCore.Server, 2.50.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Grpc.AspNetCore.Server as a Cake Addin
#addin nuget:?package=Grpc.AspNetCore.Server&version=2.50.0

// Install Grpc.AspNetCore.Server as a Cake Tool
#tool nuget:?package=Grpc.AspNetCore.Server&version=2.50.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.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0
.NET Core netcoreapp3.0 netcoreapp3.1
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (70)

Showing the top 5 NuGet packages that depend on Grpc.AspNetCore.Server:

Package Downloads
Grpc.AspNetCore.Server.ClientFactory The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

HttpClientFactory integration the for gRPC .NET client when running in ASP.NET Core

Grpc.AspNetCore.Server.Reflection The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Automatic discovery of services for Grpc.Reflection

protobuf-net.Grpc.AspNetCore The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Package Description

prometheus-net.AspNetCore.Grpc The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

ASP.NET Core gRPC integration with Prometheus

protobuf-net.Grpc.AspNetCore.Reflection The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Package Description

GitHub repositories (19)

Showing the top 5 popular GitHub repositories that depend on Grpc.AspNetCore.Server:

Repository Stars
dotnet-architecture/eShopOnContainers
Cross-platform .NET sample microservices and container based application that runs on Linux Windows and macOS. Powered by .NET 6, Docker Containers and Azure Kubernetes Services. Supports Visual Studio, VS for Mac and CLI based environments with Docker CLI, dotnet CLI, VS Code or any other code editor.
dodyg/practical-aspnetcore
Practical samples of ASP.NET Core 2.1, 2.2, 3.1, 5.0, 6.0 and 7.0 projects you can use. Readme contains explanations on all projects.
ServiceStack/ServiceStack
Thoughtfully architected, obscenely fast, thoroughly enjoyable web services for all
grpc/grpc-dotnet
gRPC for .NET
Cysharp/MagicOnion
Unified Realtime/API framework for .NET platform and Unity.
Version Downloads Last updated
2.50.0 23,619 11/17/2022
2.50.0-pre1 2,703 11/3/2022
2.49.0 513,029 9/26/2022
2.49.0-pre1 3,051 9/1/2022
2.48.0 454,256 8/24/2022
2.48.0-pre1 1,612 8/17/2022
2.47.0 636,889 7/3/2022
2.47.0-pre1 2,007 6/23/2022
2.46.0 1,176,056 5/13/2022
2.46.0-pre1 1,929 4/28/2022
2.45.0 709,700 4/19/2022
2.45.0-pre1 2,924 4/7/2022
2.44.0 794,991 3/17/2022
2.44.0-pre1 14,077 3/9/2022
2.43.0 482,093 2/25/2022
2.43.0-pre1 7,746 1/28/2022
2.42.0 1,089,234 1/19/2022
2.42.0-pre1 7,036 12/30/2021
2.41.0 957,674 12/7/2021
2.41.0-pre1 16,400 11/12/2021
2.40.0 2,057,773 10/5/2021
2.40.0-pre1 4,739 9/9/2021
2.39.0 1,021,075 8/18/2021
2.39.0-pre1 3,956 8/6/2021
2.38.0 1,515,125 6/11/2021
2.38.0-pre1 676 6/4/2021
2.37.0 1,122,365 4/20/2021
2.37.0-pre1 419 4/14/2021
2.36.0 1,461,473 3/17/2021
2.36.0-pre1 1,788 3/9/2021
2.35.0 648,427 2/4/2021
2.35.0-pre1 1,520 1/26/2021
2.34.0 1,868,513 12/11/2020
2.34.0-pre1 2,914 12/1/2020
2.33.1 1,185,303 10/28/2020
2.33.1-pre1 736 10/22/2020
2.32.0 855,235 10/5/2020
2.32.0-pre1 12,931 9/8/2020
2.31.0 543,515 8/14/2020
2.31.0-pre2 945 8/3/2020
2.30.0 369,251 7/16/2020
2.30.0-pre1 11,886 6/17/2020
2.29.0 715,010 5/27/2020
2.29.0-pre1 2,730 5/15/2020
2.28.0 1,425,508 4/9/2020
2.28.0-pre2 20,717 3/11/2020
2.28.0-pre1 5,968 3/3/2020
2.27.0 1,393,947 2/7/2020
2.27.0-pre1 7,551 1/24/2020
2.26.0 356,699 12/19/2019
2.26.0-pre1 728 12/10/2019
2.25.0 1,034,215 11/7/2019
2.25.0-pre1 702 11/1/2019
2.24.0 280,512 10/21/2019
2.24.0-pre1 1,416 10/9/2019
2.23.2 220,322 9/20/2019
0.2.23-pre2 9,846 9/6/2019
0.2.23-pre1 6,709 8/21/2019
0.1.22-pre3 7,662 7/30/2019
0.1.22-pre2 12,086 7/2/2019
0.1.22-pre1 5,219 6/17/2019
0.1.21-pre1 13,241 6/4/2019
0.1.20-pre1 10,628 4/9/2019
0.1.19-pre1 4,826 2/21/2019