Aspire Orchestration
MANDATORY COMPLIANCE — This skill prevents agent self-harm in Aspire projects.
Violating these rules causes file locks, orphaned processes, and user frustration (
#15801).
Prerequisites
| Requirement | Install |
|---|
| .NET 10.0 SDK | https://dotnet.microsoft.com/download |
| Aspire CLI (curl/PowerShell) | curl -sSL https://aspire.dev/install.sh | bash
|
| Aspire CLI (NativeAOT global tool, .NET 10) | dotnet tool install -g Aspire.Cli
|
Either install method works. The
path produces a NativeAOT binary
(instant startup, no JIT warmup) and is the recommended option when .NET 10 is already present.
Detection
Activate when ANY signal is present:
| Signal | How to Detect | Confidence |
|---|
| C# AppHost | containing | ✅ Definitive |
| File-based C# AppHost | or file with | ✅ Definitive |
| TypeScript AppHost | file in project | ✅ Definitive |
| Aspire config | in project root | High |
| Aspire settings | directory present | High |
| Generated TS modules | directory present | High |
| Service defaults | in project references | Medium |
See detection.md for detailed fingerprinting.
Safety Guardrails
| Situation | ✅ ALWAYS Do | ❌ NEVER Do |
|---|
| Start an Aspire app | | on AppHost |
| Wait for resource ready | | / HTTP polling loops |
| Code changed in a resource | Prefer resource commands, runtime watch/HMR, dashboard actions, or IDE-managed debugging | against locked files |
| Task complete | | Leave processes running |
| Check resource status | / | Manual process inspection |
| Working in git worktree | | without isolation |
| Running from AI agent | Add to all commands | Assuming interactive terminal |
| Editing unfamiliar API | aspire docs search <topic>
then aspire docs api search <query>
for API reference | Guessing API shape |
| C# AppHost API inspection | Use skill (if available) for local symbols | Guessing overloads or builder chains |
| Adding custom dashboard/resource commands | aspire docs search "custom resource commands"
first | Inventing patterns without docs |
| Installing Aspire support | Use or | dotnet workload install aspire
(obsolete) |
See safety-guardrails.md for detailed rules and recovery patterns.
Default Workflow
- Confirm workspace is Aspire — identify the AppHost
- (or in worktrees)
- before interacting with any resource
- to inspect state, then work
- If AppHost code changed, rerun ; if only one resource changed, prefer the resource's commands/watch/HMR/debug workflow
- when cleanup is explicitly requested or needed to release locks/ports
Quick Reference
| Task | Command |
|---|
| Start app (agents) | (background, preferred) |
| Start app (human) | (foreground, dashboard) |
| Stop app | |
| Wait for resource | |
| Check status | or |
| Show hidden resources (proxies, helpers, migrations) | aspire ps --include-hidden
/ aspire describe --include-hidden
|
| Resource operation | aspire resource <resource-name> <command>
such as , , or when exposed |
| Create new project | aspire new aspire-starter
|
| Add Aspire to existing | (then hand off to skill for wiring) |
| Add integration | |
| Discover integrations | aspire integration list --format Json
/ aspire integration search <query> --format Json
|
| Upgrade the CLI itself | |
| Update project package refs | (modifies project files — get user approval) |
| Restore generated files | |
| Environment maintenance | , , |
| Diagnose environment | |
| Machine-readable output | (supported: , , ) |
| Look up API reference | aspire docs api search <query> --language csharp|typescript
|
| Browse API entries | aspire docs api list <scope>
|
| Get API detail | |
Error Handling
| Symptom | Cause | Action |
|---|
| File lock errors during build (, ) | Aspire is running and holds locks on , , and assemblies. | Run first, then rebuild or . Do NOT conclude the project has a permanent build failure. |
| "Port already in use" | Previous instance running | , then |
| Resource not found | App not started or name wrong | to check |
| Build errors in resource | Code error, not Aspire issue | Fix code, then use resource commands/watch/HMR/debug workflow or rerun if AppHost code changed |
| Environment issues | Missing SDK or tools | to diagnose |
| JSON parse failure from | Mixed human/JSON output (#15843) | Strip non-JSON lines before parsing |
| rejects name | Use not (#15842) | Use from |
| hangs | AppHost on breakpoint (#15576) | Use timeout, check AppHost process |
| fails | Non-interactive terminal (#16264) | Run from standard terminal |
| Docker daemon unavailable | Container-backed resources fail to start | Start Docker Desktop, then |
| Multiple AppHosts detected | Wrong AppHost targeted | Use to specify explicitly |
🔒 File-Lock Recovery (MSB3491 / CS2012) — Always First
When a build fails with
error MSB3491: Could not write to output file ...
or
error CS2012: Cannot open ... for writing
, the project itself is healthy —
Aspire is running and holding file locks on the resource's output assemblies.
The recovery is always the same:
bash
# ✅ Correct recovery sequence
aspire stop # release the locks
# ... then either rebuild / restart one resource if the resource exposes commands ...
aspire resource <name> rebuild # example: C# project resource with rebuild command
# ... or restart the whole AppHost ...
aspire start # if AppHost code changed or Aspire was already stopped
| ❌ NEVER do | ✅ ALWAYS do |
|---|
| Tell the user the project has a permanent build failure | Recognize the lock as Aspire holding outputs and run |
| again with locks held | first, then (or prefer resource commands/watch/HMR/debug workflow) |
| Delete / to "fix" the lock | — deletion may succeed but the next build relocks |
| or to free locks | — clean shutdown via the CLI, no orphans |
| Tell the user to "reboot" or "restart your machine" | — single command, instant fix |
The same rule applies to any "file in use", "cannot access the file", or
"another process is using" error during a build of an Aspire-managed resource.
Handoff Rules
| Scenario | Route To |
|---|
| AppHost wiring after (scan repo, add resources, ServiceDefaults/OTel) | → skill () or project-local .agents/skills/aspireify/SKILL.md
|
| Browser logs ( / ) and dashboard authoring | → skill (code edits) and (discovery) |
| Custom resource commands (, , ) | → skill |
Lifecycle hooks (, SubscribeAfterResourcesCreated
, BeforeStart pipeline phase) | → skill |
| Endpoint authoring ( updates, flag) | → skill |
| Deploy, publish, pipeline steps, | → skill |
| Logs, traces, metrics, dashboard, | → skill |
| Deployed app diagnostics | → skill (azure-skills) |
Runtime Settings And Environment
| Variable | Default | Purpose |
|---|
ASPIRE_ENABLE_CONTAINER_TUNNEL
| | Container tunnel provides uniform host connectivity across Docker Desktop, Docker Engine, and Podman. Set to to opt out. |
| unset | Selects the environment-specific config profile — controls which appsettings.{environment}.json
is loaded and which environment is reported in dashboard telemetry. |
ASPIRE_DCP_USE_DEVELOPER_CERTIFICATE
| | The Aspire trusted developer certificate is used by DCP on Windows. Set to to opt out. |
features.defaultWatchEnabled
| false unless configured | Enables Aspire default watch for supported C# and TypeScript AppHosts. Do not treat this as per-resource rebuild, restart, or hot reload for resource source changes. |
TypeScript AppHost Note
Detection covers TS AppHosts (
), but
all TS AppHost authoring is delegated to .
Current rules to apply when handing off:
| Rule | Why |
|---|
Prefer unified withEnvironment(name, value)
over deprecated per-kind helpers (, , withEnvironmentConnectionString
, withEnvironmentExpression
, withEnvironmentFromOutput
, withEnvironmentFromKeyVaultSecret
) | Per-kind helpers are deprecated — single API now handles all value types |
| Never edit directly | Generated; use to regenerate and to recover missing files |
Use aspire docs api search <query> --language typescript
for API lookup | TS surface differs from C# |
Skill Routing — In-Plugin Sibling Skills
After
drops a skeleton AppHost +
, route AppHost wiring
(scan repo → propose resource graph → edit AppHost → wire
/ OTel →
validate via
) to the in-plugin
aspireify skill:
.
For first-run flows that only need the skeleton drop, see the in-plugin
aspire-init skill:
. This orchestration skill stays focused
on lifecycle (start/stop/wait/restart) and never edits AppHost code itself.
Project-Local Skill Precedence
If
.agents/skills/aspire/SKILL.md
exists (from
), defer to it for:
C# AppHost editing, TS AppHost editing, Playwright handoff, investigation workflows.
Safety guardrails from this plugin ALWAYS apply.
If
.agents/skills/aspireify/SKILL.md
exists project-locally (installed by
in
current Aspire),
warn the user that a project-local aspireify skill is present and
defer to it
for AppHost wiring instead of the in-plugin sibling. Same precedence rule as the project-local
skill above: project-local wins, plugin guardrails still apply.
References
- safety-guardrails.md — Detailed rules and recovery patterns
- detection.md — Project fingerprinting
- app-commands.md — App lifecycle and bootstrap commands
- resource-management.md — Resource wait, restart, and operations
- agent-workflows.md — Common agent investigation, integration, TypeScript, and handoff workflows