Getting Started
Zero-friction integration between .NET Aspire and Microsoft Orleans for ADO.NET storage backends. Automatically provisions Orleans database schemas and wires up clustering, grain persistence, and reminders from Aspire configuration — no manual SQL scripts or connection string plumbing required.
Frameworks
.NET
Packages
Section titled “Packages”| Package | NuGet |
|---|---|
| Aspire AppHost | |
| Orleans Silo | |
| Orleans Client |
Features
Section titled “Features”- Automatic schema provisioning — Orleans clustering, persistence, and reminder tables are created automatically when the database becomes ready
- Zero connection string plumbing — connection strings and ADO.NET invariants are resolved from Aspire configuration
- Multi-database support — PostgreSQL, SQL Server, and MySQL are auto-detected from the Aspire resource
- Feature selection — choose which Orleans features to provision (clustering, persistence, reminders) via flags
- Multiple grain storage providers — configure named grain storage providers pointing to different databases
Supported Databases
Section titled “Supported Databases”| Database | Provider |
|---|---|
| PostgreSQL | Npgsql |
| SQL Server | Microsoft.Data.SqlClient |
| MySQL | MySqlConnector |
Quick Start
Section titled “Quick Start”-
Install packages into your projects
-
Configure the Aspire AppHost
using Shiny.Aspire.Orleans.Hosting;var builder = DistributedApplication.CreateBuilder(args);var db = builder.AddPostgres("pg").AddDatabase("orleans-db");var orleans = builder.AddOrleans("cluster").WithClustering(db).WithGrainStorage("Default", db).WithReminders(db).WithDatabaseSetup(db); // creates all Orleans tables automaticallybuilder.AddProject<Projects.MySilo>("silo").WithReference(orleans).WaitFor(db);builder.AddProject<Projects.MyApi>("api").WithReference(orleans.AsClient()).WaitFor(db);builder.Build().Run(); -
Configure the Orleans Silo
using Shiny.Aspire.Orleans.Server;var builder = WebApplication.CreateBuilder(args);builder.UseOrleans(silo =>{silo.UseAdoNet();});var app = builder.Build();app.Run(); -
Configure the Orleans Client
using Shiny.Aspire.Orleans.Client;var builder = WebApplication.CreateBuilder(args);builder.UseOrleansClient(client =>{client.UseAdoNetClient();});var app = builder.Build();app.MapGet("/counter/{name}", async (string name, IClusterClient client) =>{var grain = client.GetGrain<ICounterGrain>(name);var count = await grain.GetCount();return Results.Ok(new { name, count });});app.Run();
AI Coding Assistant
Section titled “AI Coding Assistant”claude plugin add github:shinyorg/skills/shiny-aspire - Open the shiny-aspire skill file and copy its contents
- In your repository, create
.github/copilot-instructions.mdif it doesn't exist - Paste the skill content into that file and save
Copilot will automatically pick up the instructions on your next chat or code completion. You can also use path-specific instructions by placing the file in .github/instructions/ with an applyTo frontmatter pattern.
Requirements
Section titled “Requirements”- .NET 10
- .NET Aspire 13.1+
- Microsoft Orleans 10.0+