Microsoft.Orleans.GrainDirectory.Redis
10.2.1
Prefix Reserved
dotnet add package Microsoft.Orleans.GrainDirectory.Redis --version 10.2.1
NuGet\Install-Package Microsoft.Orleans.GrainDirectory.Redis -Version 10.2.1
<PackageReference Include="Microsoft.Orleans.GrainDirectory.Redis" Version="10.2.1" />
<PackageVersion Include="Microsoft.Orleans.GrainDirectory.Redis" Version="10.2.1" />Directory.Packages.props
<PackageReference Include="Microsoft.Orleans.GrainDirectory.Redis" />Project file
paket add Microsoft.Orleans.GrainDirectory.Redis --version 10.2.1
#r "nuget: Microsoft.Orleans.GrainDirectory.Redis, 10.2.1"
#:package Microsoft.Orleans.GrainDirectory.Redis@10.2.1
#addin nuget:?package=Microsoft.Orleans.GrainDirectory.Redis&version=10.2.1Install as a Cake Addin
#tool nuget:?package=Microsoft.Orleans.GrainDirectory.Redis&version=10.2.1Install as a Cake Tool
Microsoft Orleans Grain Directory for Redis
Introduction
Microsoft Orleans Grain Directory for Redis provides a grain directory implementation using Redis. The grain directory is used to locate active grain instances across the cluster, and this package allows Orleans to store that information in Redis.
Getting Started
To use this package, install it via NuGet:
dotnet add package Microsoft.Orleans.GrainDirectory.Redis
Example - Configuring Redis Grain Directory
using Microsoft.Extensions.Hosting;
using Orleans.Hosting;
var builder = Host.CreateApplicationBuilder(args)
.UseOrleans(siloBuilder =>
{
siloBuilder
.UseLocalhostClustering()
// Configure Redis as the grain directory
.UseRedisGrainDirectoryAsDefault(options =>
{
options.ConnectionString = "localhost:6379";
options.Database = 0;
});
});
// Run the host
await builder.RunAsync();
Configuration via Microsoft.Extensions.Configuration
You can configure Orleans Redis grain directory using Microsoft.Extensions.Configuration (such as appsettings.json) instead of configuring it in code. When using this approach, Orleans will automatically read the configuration from the Orleans section.
Note: You can use either
"ProviderType": "Redis"or"ProviderType": "AzureRedisCache"- both are supported and functionally equivalent.
Example - appsettings.json
{
"ConnectionStrings": {
"redis": "localhost:6379"
},
"Orleans": {
"ClusterId": "my-cluster",
"ServiceId": "MyOrleansService",
"GrainDirectory": {
"Default": {
"ProviderType": "Redis",
"ServiceKey": "redis"
}
}
}
}
.NET Aspire Integration
For applications using .NET Aspire, consider using the .NET Aspire Redis integration which provides simplified Redis configuration, automatic service discovery, health checks, and telemetry. The Aspire integration automatically configures connection strings that Orleans can consume via the configuration system.
Example - Program.cs with Aspire Redis Integration
using Microsoft.Extensions.Hosting;
using Orleans.Hosting;
using Microsoft.Extensions.DependencyInjection;
var builder = Host.CreateApplicationBuilder(args);
// Add service defaults (Aspire configurations)
builder.AddServiceDefaults();
// Add Redis via Aspire client integration
builder.AddKeyedRedisClient("redis");
// Add Orleans
builder.UseOrleans();
var host = builder.Build();
await host.StartAsync();
// Get a reference to a grain and call it
var client = host.Services.GetRequiredService<IClusterClient>();
var grain = client.GetGrain<IMyGrain>("user123");
var response = await grain.SayHello("Aspire Redis Grain Directory");
Console.WriteLine($"Grain response: {response}");
await host.WaitForShutdownAsync();
This example assumes your AppHost project has configured Redis like this:
// In your AppHost/Program.cs
var builder = DistributedApplication.CreateBuilder(args);
var redis = builder.AddRedis("redis");
var orleans = builder.AddOrleans("orleans")
.WithGrainDirectory("Default", redis);
builder.AddProject<Projects.MyOrleansApp>("orleans-app")
.WithReference(orleans);
builder.Build().Run();
Documentation
For more comprehensive documentation, please refer to:
Feedback & Contributing
- If you have any issues or would like to provide feedback, please open an issue on GitHub
- Join our community on Discord
- Follow the @msftorleans Twitter account for Orleans announcements
- Contributions are welcome! Please review our contribution guidelines
- This project is licensed under the MIT license
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 is compatible. 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. |
-
net10.0
- Microsoft.AspNetCore.Connections.Abstractions (>= 10.0.3)
- Microsoft.CodeAnalysis.Analyzers (>= 3.11.0)
- Microsoft.CodeAnalysis.Common (>= 5.0.0)
- Microsoft.CodeAnalysis.Workspaces.Common (>= 5.0.0)
- Microsoft.Extensions.Configuration (>= 10.0.5)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.5)
- Microsoft.Extensions.Configuration.Json (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.DependencyModel (>= 10.0.5)
- Microsoft.Extensions.Hosting (>= 10.0.5)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Console (>= 10.0.5)
- Microsoft.Extensions.Logging.Debug (>= 10.0.5)
- Microsoft.Extensions.ObjectPool (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.5)
- Microsoft.Orleans.Analyzers (>= 10.2.1)
- Microsoft.Orleans.CodeGenerator (>= 10.2.1)
- Microsoft.Orleans.Runtime (>= 10.2.1)
- Newtonsoft.Json (>= 13.0.4)
- StackExchange.Redis (>= 2.11.0)
- System.Diagnostics.PerformanceCounter (>= 10.0.3)
- System.IO.Hashing (>= 10.0.3)
- System.Memory.Data (>= 10.0.3)
-
net8.0
- Microsoft.AspNetCore.Connections.Abstractions (>= 8.0.24)
- Microsoft.CodeAnalysis.Analyzers (>= 3.11.0)
- Microsoft.CodeAnalysis.Common (>= 4.5.0)
- Microsoft.CodeAnalysis.Workspaces.Common (>= 4.5.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.Configuration.Json (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.DependencyModel (>= 8.0.2)
- Microsoft.Extensions.Hosting (>= 8.0.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- Microsoft.Extensions.Logging.Console (>= 8.0.1)
- Microsoft.Extensions.Logging.Debug (>= 8.0.1)
- Microsoft.Extensions.ObjectPool (>= 8.0.24)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Microsoft.Orleans.Analyzers (>= 10.2.1)
- Microsoft.Orleans.CodeGenerator (>= 10.2.1)
- Microsoft.Orleans.Runtime (>= 10.2.1)
- Newtonsoft.Json (>= 13.0.4)
- StackExchange.Redis (>= 2.11.0)
- System.Diagnostics.PerformanceCounter (>= 8.0.1)
- System.IO.Hashing (>= 10.0.3)
- System.IO.Pipelines (>= 8.0.0)
- System.Memory.Data (>= 8.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Microsoft.Orleans.GrainDirectory.Redis:
| Package | Downloads |
|---|---|
|
NetProOA.Framework.Orleans.Client.RedisDB
Client.RedisDB |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.2.1 | 478 | 6/24/2026 |
| 10.2.1-preview.1 | 48 | 6/19/2026 |
| 10.2.0 | 492 | 6/12/2026 |
| 10.1.1-preview.1 | 64 | 5/13/2026 |
| 10.1.0 | 10,885 | 4/14/2026 |
| 10.0.1 | 16,472 | 2/7/2026 |
| 10.0.0 | 3,273 | 1/20/2026 |
| 10.0.0-rc.2 | 282 | 12/31/2025 |
| 9.2.1 | 32,574 | 7/16/2025 |
| 9.2.0 | 644 | 7/14/2025 |
| 9.2.0-preview3 | 727 | 6/10/2025 |
| 9.2.0-preview2 | 245 | 6/4/2025 |
| 9.2.0-preview1 | 436 | 4/4/2025 |
| 9.1.2 | 51,438 | 2/13/2025 |
| 3.8.1-beta1 | 106 | 4/24/2026 |
| 3.8.0-preview5 | 314 | 5/12/2025 |
| 3.8.0-preview3 | 270 | 4/8/2025 |
| 3.8.0-preview2 | 217 | 4/4/2025 |
| 3.8.0-preview1 | 271 | 3/31/2025 |
| 3.8.0-beta1 | 231 | 5/6/2025 |