Grpc.Net.ClientFactory 2.85.0

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);
            }
        }
    }
}

Showing the top 20 packages that depend on Grpc.Net.ClientFactory.

Packages Downloads
Aspire.Hosting
Core abstractions for the Aspire application model.
41
Aspire.Hosting
Core abstractions for the Aspire application model.
29
Aspire.Hosting.Redis
Redis® support for Aspire.
27
Aspire.Hosting
Core abstractions for the .NET Aspire application model.
26
Microsoft.Azure.Functions.Worker.Grpc
This library provides gRPC support for Azure Functions .NET Worker communication with the Azure Functions Host.
26
Aspire.Hosting
Core abstractions for the Aspire application model.
25
Aspire.Hosting.Redis
Redis® support for Aspire.
23
Microsoft.Azure.Functions.Worker.Grpc
This library provides gRPC support for Azure Functions .NET Worker communication with the Azure Functions Host.
23
Aspire.Hosting
Core abstractions for the .NET Aspire application model.
23
Aspire.Hosting.Redis
Redis® support for Aspire.
22
Aspire.Hosting
Core abstractions for the .NET Aspire application model.
22
Aspire.Hosting
Core abstractions for the Aspire application model.
22
Aspire.Hosting
Core abstractions for the .NET Aspire application model.
21
Microsoft.Azure.Functions.Worker.Grpc
This library provides gRPC support for Azure Functions .NET Worker communication with the Azure Functions Host.
21
Aspire.Hosting.Redis
Redis® support for .NET Aspire.
20
Aspire.Hosting
Core abstractions for the .NET Aspire application model.
20
Aspire.Hosting.Redis
Redis® support for Aspire.
20
Aspire.Hosting
Core abstractions for the Aspire application model.
20

.NET 10.0

.NET 8.0

.NET 9.0

.NET Standard 2.0

.NET Standard 2.1

Version Downloads Last updated
2.85.0 2 10/30/2026
2.84.0 15 09/23/2026
2.84.0-pre1 6 09/19/2026
2.83.0 14 08/06/2026
2.83.0-pre1 18 07/24/2026
2.80.0 15 06/20/2026
2.80.0-pre1 9 06/20/2026
2.76.0 11 06/21/2026
2.76.0-pre1 23 06/21/2026
2.71.0 8 07/06/2026
2.71.0-pre1 13 06/20/2026
2.70.0 16 06/20/2026
2.70.0-pre1 18 07/11/2026
2.67.0 8 06/20/2026
2.67.0-pre1 15 06/30/2026
2.66.0 14 06/21/2026
2.66.0-pre1 14 06/21/2026
2.65.0 9 07/02/2026
2.65.0-pre1 14 06/21/2026
2.64.0 8 07/30/2026
2.64.0-pre1 15 06/21/2026
2.63.0 16 06/20/2026
2.63.0-pre1 13 06/30/2026
2.62.0 14 06/20/2026
2.62.0-pre1 12 06/21/2026
2.61.0 14 06/20/2026
2.61.0-pre1 9 06/25/2026
2.60.0 17 07/15/2024
2.60.0-pre1 15 06/29/2026
2.59.0 11 06/20/2026
2.59.0-pre1 14 06/20/2026
2.58.0 17 07/01/2026
2.58.0-pre1 13 06/21/2026
2.57.0 14 07/30/2026
2.57.0-pre1 17 06/20/2026
2.56.0 14 06/20/2026
2.56.0-pre2 9 07/06/2026
2.56.0-pre1 12 06/20/2026
2.55.0 11 06/20/2024
2.55.0-pre1 15 06/20/2026
2.54.0 12 06/30/2026
2.54.0-pre1 25 06/20/2026
2.53.0 13 06/20/2026
2.53.0-pre1 15 07/06/2026
2.52.0 12 06/20/2026
2.52.0-pre1 12 06/20/2026
2.51.0 14 06/21/2026
2.51.0-pre1 10 06/20/2026
2.50.0 12 06/20/2026
2.50.0-pre1 15 06/20/2026
2.49.0 18 07/19/2024
2.49.0-pre1 18 06/20/2026
2.48.0 11 06/20/2026
2.48.0-pre1 18 06/20/2026
2.47.0 15 06/20/2026
2.47.0-pre1 11 06/20/2026
2.46.0 15 06/20/2026
2.46.0-pre1 5 06/29/2026
2.45.0 17 06/20/2026
2.45.0-pre1 17 06/20/2026
2.44.0 12 07/06/2026
2.44.0-pre1 14 07/05/2026
2.43.0 9 07/06/2026
2.43.0-pre1 11 06/27/2026
2.42.0 11 07/04/2026
2.42.0-pre1 16 06/20/2026
2.41.0 10 07/06/2026
2.41.0-pre1 9 06/21/2026
2.40.0 8 06/20/2026
2.40.0-pre1 18 06/20/2026
2.39.0 10 06/21/2026
2.39.0-pre1 14 06/20/2026
2.38.0 13 06/20/2026
2.38.0-pre1 9 07/03/2026
2.37.0 15 06/20/2026
2.37.0-pre1 10 06/20/2026
2.36.0 14 07/01/2026
2.36.0-pre1 8 07/03/2026
2.35.0 11 07/01/2026
2.35.0-pre1 9 06/21/2026
2.34.0 11 06/29/2026
2.34.0-pre1 14 06/20/2026
2.33.1 8 07/04/2026
2.33.1-pre1 13 06/21/2026
2.32.0 16 06/20/2026
2.32.0-pre1 8 06/20/2026
2.31.0 8 06/20/2026
2.31.0-pre2 12 06/20/2026
2.30.0 7 06/20/2026
2.30.0-pre1 12 06/20/2026
2.29.0 6 06/20/2026
2.29.0-pre1 17 06/20/2026
2.28.0 12 06/27/2026
2.28.0-pre2 13 06/24/2026
2.28.0-pre1 10 06/20/2026
2.27.0 9 06/20/2026
2.27.0-pre1 10 07/07/2026
2.26.0 16 06/20/2026
2.26.0-pre1 13 06/20/2026
2.25.0 9 06/20/2026
2.25.0-pre1 14 06/20/2026
2.24.0 9 07/04/2026
2.24.0-pre1 10 07/07/2026
2.23.2 11 06/20/2026
0.2.23-pre2 19 06/20/2026
0.2.23-pre1 11 06/20/2026
0.1.22-pre3 6 07/06/2026
0.1.22-pre2 15 06/21/2026
0.1.22-pre1 16 06/20/2026
0.1.21-pre1 15 06/24/2026