Grpc.Net.ClientFactory 2.71.0

Prefix Reserved
dotnet add package Grpc.Net.ClientFactory --version 2.71.0
                    
NuGet\Install-Package Grpc.Net.ClientFactory -Version 2.71.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.Net.ClientFactory" Version="2.71.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Grpc.Net.ClientFactory" Version="2.71.0" />
                    
Directory.Packages.props
<PackageReference Include="Grpc.Net.ClientFactory" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Grpc.Net.ClientFactory --version 2.71.0
                    
#r "nuget: Grpc.Net.ClientFactory, 2.71.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Grpc.Net.ClientFactory@2.71.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Grpc.Net.ClientFactory&version=2.71.0
                    
Install as a Cake Addin
#tool nuget:?package=Grpc.Net.ClientFactory&version=2.71.0
                    
Install as a Cake Tool

Grpc.Net.ClientFactory

gRPC integration with HttpClientFactory offers a centralized way to create gRPC clients. It can be used as an alternative to configuring stand-alone gRPC client instances.

The factory offers the following benefits:

  • Provides a central location for configuring logical gRPC client instances
  • Manages the lifetime of the underlying HttpClientMessageHandler
  • Automatic propagation of deadline and cancellation in an ASP.NET Core gRPC service

Register gRPC clients

To register a gRPC client, the generic AddGrpcClient extension method can be used within Startup.ConfigureServices, specifying the gRPC typed client class and service address:

services.AddGrpcClient<Greeter.GreeterClient>(o =>
{
    o.Address = new Uri("https://localhost:5001");
});

The gRPC client type is registered as transient with dependency injection (DI). The client can now be injected and consumed directly in types created by DI. ASP.NET Core MVC controllers, SignalR hubs and gRPC services are places where gRPC clients can automatically be injected:

public class AggregatorService : Aggregator.AggregatorBase
{
    private readonly Greeter.GreeterClient _client;

    public AggregatorService(Greeter.GreeterClient client)
    {
        _client = client;
    }

    public override async Task SayHellos(HelloRequest request,
        IServerStreamWriter<HelloReply> responseStream, ServerCallContext context)
    {
        // Forward the call on to the greeter service
        using (var call = _client.SayHellos(request))
        {
            await foreach (var response in call.ResponseStream.ReadAllAsync())
            {
                await responseStream.WriteAsync(response);
            }
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (243)

Showing the top 5 NuGet packages that depend on Grpc.Net.ClientFactory:

Package Downloads
Grpc.AspNetCore.Server.ClientFactory

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

Microsoft.Azure.Functions.Worker.Grpc

This library provides gRPC support for Azure Functions .NET Worker communication with the Azure Functions Host.

CouchbaseNetClient

The Official Couchbase .NET SDK.

Microsoft.Azure.Functions.Worker.Extensions.Rpc

Contains types to facilitate RPC communication between a worker extension and the functions host.

Aspire.Hosting

Core abstractions for the .NET Aspire application model.

GitHub repositories (38)

Showing the top 20 popular GitHub repositories that depend on Grpc.Net.ClientFactory:

Repository Stars
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
dotnet/eShop
A reference .NET application implementing an eCommerce site
kurrent-io/KurrentDB
KurrentDB is a database that's engineered for modern software applications and event-driven architectures. Its event-native design simplifies data modeling and preserves data integrity while the integrated streaming engine solves distributed messaging challenges and ensures data consistency.
dotnet/aspire
Tools, templates, and packages to accelerate building observable, production-ready apps
sipsorcery-org/sipsorcery
A WebRTC, SIP and VoIP library for C# and .NET. Designed for real-time communications apps.
AlphaYu/adnc
.NET微服务/分布式开发框架,同时也适用于单体架构系统的开发。
meysamhadeli/booking-microservices
A practical microservices with the latest technologies and architectures like Vertical Slice Architecture, Event Sourcing, CQRS, DDD, gRpc, MongoDB, RabbitMq, Masstransit, and Aspire in .Net 9.
dapr/dotnet-sdk
Dapr SDK for .NET
desenvolvedor-io/dev-store
A microservices e-commerce reference application built with ASP.NET 9
dotnet/aspire-samples
mehdihadeli/food-delivery-microservices
🍔 A practical and cloud-native food delivery microservices, built with .Net Aspire, .Net 9, MassTransit, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
protobuf-net/protobuf-net.Grpc
GRPC bindings for protobuf-net and grpc-dotnet
abpframework/eShopOnAbp
Reference microservice solution built with the ABP Framework and .NET, runs on Kubernetes with Helm configuration, includes API Gateways, Angular and ASP.NET Core MVC applications, PostgreSQL and MongoDB databases
csharpfritz/csharp_with_csharpfritz
Show notes, slides, and samples from the CSharp with CSharpFritz show
microsoft/RockPaperScissorsLizardSpock
Rock, Paper, Scissors, Lizard, Spock - Sample Application
elastic/apm-agent-dotnet
ardalis/DesignPatternsInCSharp
Samples associated with Pluralsight design patterns in c# courses.
Azure/azure-functions-dotnet-worker
Azure Functions out-of-process .NET language worker
ChromaControl/ChromaControl
3rd party device lighting support for Razer Synapse.
AntonioFalcaoJr/EventualShop
A state-of-the-art distributed system using Reactive DDD as uncertainty modeling, Event Storming as subdomain decomposition, Event Sourcing as an eventual persistence mechanism, CQRS, Async Projections, Microservices for individual deployable units, Event-driven Architecture for efficient integration, and Clean Architecture as domain-centric design
Version Downloads Last Updated
2.71.0 3,821,420 4/25/2025
2.71.0-pre1 968 4/16/2025
2.70.0 2,408,025 3/10/2025
2.70.0-pre1 2,407 2/26/2025
2.67.0 5,858,417 11/21/2024
2.67.0-pre1 13,129 10/22/2024
2.66.0 6,930,657 9/20/2024
2.66.0-pre1 7,025 9/6/2024
2.65.0 15,023,453 7/27/2024
2.65.0-pre1 1,212 7/20/2024
2.64.0 682,543 7/19/2024
2.64.0-pre1 24,177 7/15/2024
2.63.0 4,136,905 5/24/2024
2.63.0-pre1 21,826 5/8/2024
2.62.0 4,032,997 3/29/2024
2.62.0-pre1 4,945 3/8/2024
2.61.0 3,939,566 2/22/2024
2.61.0-pre1 11,562 2/8/2024
2.60.0 23,981,245 1/3/2024
2.60.0-pre1 17,438 12/14/2023
2.59.0 5,145,374 11/8/2023
2.59.0-pre1 8,322 10/27/2023
2.58.0 1,244,423 10/19/2023
2.58.0-pre1 32,606 10/9/2023
2.57.0 4,306,186 9/6/2023
2.57.0-pre1 4,762 8/31/2023
2.56.0 617,480 8/25/2023
2.56.0-pre2 4,611 8/16/2023
2.56.0-pre1 29,059 8/3/2023
2.55.0 24,892,670 7/4/2023
2.55.0-pre1 5,398 6/23/2023
2.54.0 1,476,889 6/15/2023
2.54.0-pre1 12,201 5/25/2023
2.53.0 3,087,616 5/5/2023
2.53.0-pre1 19,164 4/12/2023
2.52.0 3,482,896 3/15/2023
2.52.0-pre1 8,297 3/3/2023
2.51.0 7,252,663 1/2/2023
2.51.0-pre1 7,301 12/7/2022
2.50.0 3,565,704 11/17/2022
2.50.0-pre1 28,556 11/3/2022
2.49.0 29,122,272 9/26/2022
2.49.0-pre1 3,920 9/1/2022
2.48.0 2,602,142 8/24/2022
2.48.0-pre1 2,895 8/17/2022
2.47.0 3,605,696 7/3/2022
2.47.0-pre1 3,357 6/23/2022
2.46.0 3,560,970 5/13/2022
2.46.0-pre1 8,238 4/28/2022
2.45.0 1,977,519 4/19/2022
2.45.0-pre1 12,836 4/7/2022
2.44.0 1,958,566 3/17/2022
2.44.0-pre1 19,961 3/9/2022
2.43.0 1,564,739 2/25/2022
2.43.0-pre1 10,883 1/28/2022
2.42.0 3,886,704 1/19/2022
2.42.0-pre1 10,482 12/30/2021
2.41.0 1,708,386 12/7/2021
2.41.0-pre1 21,089 11/12/2021
2.40.0 6,350,099 10/5/2021
2.40.0-pre1 4,740 9/9/2021
2.39.0 1,674,586 8/18/2021
2.39.0-pre1 6,008 8/6/2021
2.38.0 2,306,146 6/11/2021
2.38.0-pre1 1,961 6/4/2021
2.37.0 8,507,148 4/20/2021
2.37.0-pre1 1,552 4/14/2021
2.36.0 1,339,360 3/17/2021
2.36.0-pre1 1,964 3/9/2021
2.35.0 1,479,946 2/4/2021
2.35.0-pre1 2,516 1/26/2021
2.34.0 2,182,308 12/11/2020
2.34.0-pre1 4,078 12/1/2020
2.33.1 1,340,629 10/28/2020
2.33.1-pre1 1,805 10/22/2020
2.32.0 1,996,815 10/5/2020
2.32.0-pre1 14,586 9/8/2020
2.31.0 1,053,137 8/14/2020
2.31.0-pre2 1,965 8/3/2020
2.30.0 484,614 7/16/2020
2.30.0-pre1 4,484 6/17/2020
2.29.0 689,986 5/27/2020
2.29.0-pre1 6,802 5/15/2020
2.28.0 768,843 4/9/2020
2.28.0-pre2 17,551 3/11/2020
2.28.0-pre1 7,663 3/3/2020
2.27.0 1,677,663 2/7/2020
2.27.0-pre1 24,917 1/24/2020
2.26.0 1,560,712 12/19/2019
2.26.0-pre1 1,762 12/10/2019
2.25.0 1,047,691 11/7/2019
2.25.0-pre1 1,750 11/1/2019
2.24.0 349,455 10/21/2019
2.24.0-pre1 2,182 10/9/2019
2.23.2 734,828 9/20/2019
0.2.23-pre2 10,356 9/6/2019
0.2.23-pre1 13,516 8/21/2019
0.1.22-pre3 8,257 7/30/2019
0.1.22-pre2 12,996 7/2/2019
0.1.22-pre1 3,016 6/17/2019
0.1.21-pre1 2,209 6/4/2019