Grpc.Net.ClientFactory 2.71.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
Microsoft.Azure.Functions.Worker.Grpc
This library provides gRPC support for Azure Functions .NET Worker communication with the Azure Functions Host.
75
Microsoft.Azure.Functions.Worker.Grpc
This library provides gRPC support for Azure Functions .NET Worker communication with the Azure Functions Host.
31
Microsoft.Azure.Functions.Worker.Grpc
This library provides gRPC support for Azure Functions .NET Worker communication with the Azure Functions Host.
30
Microsoft.Azure.Functions.Worker.Grpc
This library provides gRPC support for Azure Functions .NET Worker communication with the Azure Functions Host.
29
Microsoft.Azure.Functions.Worker.Grpc
This library provides gRPC support for Azure Functions .NET Worker communication with the Azure Functions Host.
28
Microsoft.Azure.Functions.Worker.Grpc
This library provides gRPC support for Azure Functions .NET Worker communication with the Azure Functions Host.
27
Grpc.AspNetCore.Server.ClientFactory
HttpClientFactory integration the for gRPC .NET client when running in ASP.NET Core
27
Microsoft.Azure.Functions.Worker.Grpc
This library provides gRPC support for Azure Functions .NET Worker communication with the Azure Functions Host.
26
Microsoft.Azure.Functions.Worker
This library enables you to create an Azure Functions .NET Worker, adding support for the isolated, out-of-process execution model.
25
Grpc.AspNetCore.Server.ClientFactory
HttpClientFactory integration the for gRPC .NET client when running in ASP.NET Core
24
Microsoft.Azure.Functions.Worker
This library enables you to create an Azure Functions .NET Worker, adding support for the isolated, out-of-process execution model.
24
Microsoft.Azure.Functions.Worker.Grpc
This library provides gRPC support for Azure Functions .NET Worker communication with the Azure Functions Host.
24

.NET 6.0

.NET Standard 2.1

.NET Standard 2.0

.NET 8.0

.NET 7.0

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