Shirubasoft.Aspire.Extensions.ResourceGroups
1.2.0
dotnet add package Shirubasoft.Aspire.Extensions.ResourceGroups --version 1.2.0
NuGet\Install-Package Shirubasoft.Aspire.Extensions.ResourceGroups -Version 1.2.0
<PackageReference Include="Shirubasoft.Aspire.Extensions.ResourceGroups" Version="1.2.0" />
<PackageVersion Include="Shirubasoft.Aspire.Extensions.ResourceGroups" Version="1.2.0" />
<PackageReference Include="Shirubasoft.Aspire.Extensions.ResourceGroups" />
paket add Shirubasoft.Aspire.Extensions.ResourceGroups --version 1.2.0
#r "nuget: Shirubasoft.Aspire.Extensions.ResourceGroups, 1.2.0"
#:package Shirubasoft.Aspire.Extensions.ResourceGroups@1.2.0
#addin nuget:?package=Shirubasoft.Aspire.Extensions.ResourceGroups&version=1.2.0
#tool nuget:?package=Shirubasoft.Aspire.Extensions.ResourceGroups&version=1.2.0
Shirubasoft.Aspire.Extensions.ResourceGroups
Group related Aspire resources under logical parents without replacing their standard registration methods.
Install
Add the package to an Aspire AppHost:
dotnet add package Shirubasoft.Aspire.Extensions.ResourceGroups
The package targets .NET 10 and Aspire 13.5.3 or later within the Aspire 13.5 line.
Group resources
AddResourceGroup returns an IResourceGroupBuilder, which implements IDistributedApplicationBuilder. Call the usual Aspire registration methods on it:
using Aspire.Hosting;
var builder = DistributedApplication.CreateBuilder(args);
var backend = builder.AddResourceGroup("backend");
var api = backend.AddContainer("api", "alpine");
var worker = backend.AddContainer("worker", "alpine");
await builder.Build().RunAsync();
The dashboard shows api and worker under backend. The group is a logical resource, so Aspire omits it from published manifests and does not start a process or container for it.
A resource's own parent takes precedence over the group. This preserves child relationships created by Aspire integrations and explicit WithParentRelationship calls:
var data = builder.AddResourceGroup("data");
var database = data.AddContainer("database", "postgres", "18-alpine");
data.AddContainer("migrations", "alpine")
.WithParentRelationship(database);
Here, database belongs to data, while migrations belongs to database.
Groups can also contain groups:
var platform = builder.AddResourceGroup("platform");
var observability = platform.AddResourceGroup("observability");
observability.AddContainer("collector", "otel/opentelemetry-collector-contrib");
Run the sample
From this extension folder, run:
aspire run --project samples/ResourceGroups.AppHost/ResourceGroups.AppHost.csproj
The dashboard shows a backend group with an API, database, and a migrations child under the database.
Package contents
The NuGet package includes the assembly, XML API documentation, this README, repository metadata, Source Link data, and a matching .snupkg symbol package.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- Aspire.Hosting (>= 13.5.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.