Grpc.Net.ClientFactory 2.76.0-pre1

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.AppHost
Core library and MSBuild logic for .NET Aspire AppHost projects.
57
Grpc.AspNetCore.Server.ClientFactory
HttpClientFactory integration the for gRPC .NET client when running in ASP.NET Core
58
Grpc.AspNetCore.Server.ClientFactory
HttpClientFactory integration the for gRPC .NET client when running in ASP.NET Core
59
Grpc.AspNetCore.Server.ClientFactory
HttpClientFactory integration the for gRPC .NET client when running in ASP.NET Core
60
Grpc.AspNetCore.Server.ClientFactory
HttpClientFactory integration the for gRPC .NET client when running in ASP.NET Core
61
protobuf-net.Grpc.ClientFactory
Package Description
61
ZhonTai.Admin.Core
中台Admin权限管理核心库
58
ZhonTai.Admin.Core
中台Admin权限管理核心库
59
ZhonTai.Admin.Core
中台Admin权限管理核心库
61
ZhonTai.Admin.Core
中台Admin权限管理核心库
62
ZhonTai.Admin.Core
中台Admin权限管理核心库
65
ZhonTai.Admin.Core
中台Admin权限管理核心库
68
ZhonTai.Admin.Core
中台Admin权限管理核心库
69
ZhonTai.Admin.Core
中台Admin权限管理核心库
72
ZhonTai.Admin.Core
中台Admin权限管理核心库
73
ZhonTai.Admin.Core
中台Admin权限管理核心库
75

.NET 8.0

.NET Standard 2.1

.NET Standard 2.0

.NET 10.0

.NET 9.0

Version Downloads Last updated
2.76.0-pre1 30 11/13/2025
2.71.0 44 04/28/2025
2.71.0-pre1 43 04/18/2025
2.70.0 47 03/11/2025
2.70.0-pre1 39 03/02/2025
2.67.0 52 12/25/2024
2.67.0-pre1 41 11/15/2024
2.66.0 48 12/10/2024
2.66.0-pre1 38 12/25/2024
2.65.0 48 11/28/2024
2.65.0-pre1 55 12/25/2024
2.64.0 57 11/18/2024
2.64.0-pre1 48 12/25/2024
2.63.0 55 05/29/2024
2.63.0-pre1 54 05/29/2024
2.62.0 55 05/29/2024
2.62.0-pre1 48 05/29/2024
2.61.0 52 05/29/2024
2.61.0-pre1 48 05/29/2024
2.60.0 55 05/29/2024
2.60.0-pre1 52 05/29/2024
2.59.0 56 05/29/2024
2.59.0-pre1 56 05/29/2024
2.58.0 60 05/29/2024
2.58.0-pre1 51 12/10/2024
2.57.0 64 05/29/2024
2.57.0-pre1 55 05/29/2024
2.56.0 43 05/29/2024
2.56.0-pre2 48 05/29/2024
2.56.0-pre1 48 05/29/2024
2.55.0 56 05/29/2024
2.55.0-pre1 53 05/29/2024
2.54.0 63 05/29/2024
2.54.0-pre1 51 05/29/2024
2.53.0 52 05/29/2024
2.53.0-pre1 49 05/29/2024
2.52.0 52 05/29/2024
2.52.0-pre1 66 05/29/2024
2.51.0 60 05/29/2024
2.51.0-pre1 58 05/29/2024
2.50.0 53 05/29/2024
2.50.0-pre1 53 05/29/2024
2.49.0 62 05/29/2024
2.49.0-pre1 54 05/29/2024
2.48.0 52 05/29/2024
2.48.0-pre1 58 05/29/2024
2.47.0 56 05/29/2024
2.47.0-pre1 53 05/29/2024
2.46.0 52 05/29/2024
2.46.0-pre1 63 05/29/2024
2.45.0 59 05/29/2024
2.45.0-pre1 55 05/29/2024
2.44.0 55 05/29/2024
2.44.0-pre1 52 05/29/2024
2.43.0 51 05/29/2024
2.43.0-pre1 53 05/29/2024
2.42.0 62 05/29/2024
2.42.0-pre1 56 05/29/2024
2.41.0 53 05/29/2024
2.41.0-pre1 52 05/29/2024
2.40.0 53 05/29/2024
2.40.0-pre1 54 05/29/2024
2.39.0 49 05/29/2024
2.39.0-pre1 55 05/29/2024
2.38.0 55 05/29/2024
2.38.0-pre1 63 05/29/2024
2.37.0 56 05/29/2024
2.37.0-pre1 54 05/29/2024
2.36.0 54 05/29/2024
2.36.0-pre1 54 05/29/2024
2.35.0 57 05/29/2024
2.35.0-pre1 48 05/29/2024
2.34.0 52 05/29/2024
2.34.0-pre1 53 05/29/2024
2.33.1 61 05/29/2024
2.33.1-pre1 56 05/29/2024
2.32.0 52 05/29/2024
2.32.0-pre1 48 05/29/2024
2.31.0 49 05/29/2024
2.31.0-pre2 54 05/29/2024
2.30.0 52 05/29/2024
2.30.0-pre1 55 05/29/2024
2.29.0 50 05/29/2024
2.29.0-pre1 59 05/29/2024
2.28.0 53 05/29/2024
2.28.0-pre2 56 05/29/2024
2.28.0-pre1 52 05/29/2024
2.27.0 61 05/29/2024
2.27.0-pre1 62 05/29/2024
2.26.0 47 12/25/2024
2.26.0-pre1 51 05/29/2024
2.25.0 53 05/29/2024
2.25.0-pre1 49 05/29/2024
2.24.0 65 05/29/2024
2.24.0-pre1 57 05/29/2024
2.23.2 54 05/29/2024
0.2.23-pre2 37 12/25/2024
0.2.23-pre1 47 05/29/2024
0.1.22-pre3 61 05/29/2024
0.1.22-pre2 49 05/29/2024
0.1.22-pre1 50 05/29/2024
0.1.21-pre1 48 05/29/2024