Aspire development topology
Aspire development topology
Aspire models a distributed application as resources and dependencies, helping developers run and observe a local topology. The AppHost is a composition and orchestration tool, not the business service itself or a universal production scheduler.
Aspire has an independent release lifecycle. As of the documentation check on 2026-11-28, Aspire 17.0 is the new major release; the 13.6 lane has ended according to the current support search excerpt. Use the 17.0.0 AppHost and Dotnet hosting package candidates with an approved compatible CLI and .NET 10 SDK. Older examples using Aspire.AppHost.Sdk and AddProject<T> should be treated as migration examples, not copied blindly. In Aspire 17, AddDotnetProject identifies a .NET project by path. WithReference supplies dependency configuration; WaitFor expresses startup gating and may use resource health. Neither enforces authorization or prevents runtime outages. A dashboard displays resources and telemetry where configured; its access and secrets need protection. Service defaults are opt-in shared application code, not automatically enabled for every service. The companion lab under lab-fixtures/aspire/inventory-topology demonstrates actual AppHost source with two local ASP.NET Core projects and no database or container. It requires separately approved tooling and is NOT RUN. The three following console examples are offline topology models, not Aspire APIs or orchestrator execution.
Baseline: .NET 10 / C# 14. All C# results below are reasoned, not executed. Offline models and the separate Aspire lab are explicitly distinguished.
Describe a resource graph
Represent dependency names separately from resource kind. This offline inventory models a database without starting one.
Use the archived Fixture.csproj with an approved .NET 10 SDK. No third-party packages are required. Inspect the project, then build and run with the approved SDK.
using System;var resources = new[] { ("stock", "database"), ("inventory", "api"), ("orders", "api") };foreach (var resource in resources) Console.WriteLine($"{resource.Item1}: {resource.Item2}");Console.WriteLine("inventory -> stock");Console.WriteLine("orders -> inventory");Expected result (not executed):
stock: databaseinventory: apiorders: apiinventory -> stockorders -> inventoryThe arrows point from a consumer to its dependency. An actual AppHost would declare resources and use references to wire configuration. No database or process is launched here.
Compute a dependency-respecting start order
Model a finite directed acyclic graph. Each pass starts only nodes whose dependencies are already complete.
Use the archived Fixture.csproj with an approved .NET 10 SDK. No third-party packages are required. Inspect the project, then build and run with the approved SDK.
using System;using System.Collections.Generic;using System.Linq;var dependencies = new Dictionary<string, string[]> { ["orders"] = ["inventory"], ["inventory"] = ["stock"], ["stock"] = []};var ready = new HashSet<string>();while (ready.Count < dependencies.Count) { var next = dependencies.Keys.Where(k => !ready.Contains(k) && dependencies[k].All(ready.Contains)).OrderBy(k => k, StringComparer.Ordinal).ToArray(); if (next.Length == 0) throw new InvalidOperationException("cycle or missing dependency"); foreach (var name in next) { ready.Add(name); Console.WriteLine(name); }}Expected result (not executed):
stockinventoryordersThe algorithm models ordering, not real process readiness. Change stock to depend on orders to observe the reasoned cycle diagnostic; actual Aspire handles resource relationships according to its own APIs.
Distinguish startup gating from runtime health
Model a dependency that becomes ready, then fails after the consumer starts.
Use the archived Fixture.csproj with an approved .NET 10 SDK. No third-party packages are required. Inspect the project, then build and run with the approved SDK.
using System;bool started = false;foreach (bool dependencyReady in new[] { false, true, false, true }) { if (dependencyReady) started = true; Console.WriteLine($"started={started}; canServe={started && dependencyReady}");}Expected result (not executed):
started=False; canServe=Falsestarted=True; canServe=Truestarted=True; canServe=Falsestarted=True; canServe=TrueWaitFor-like startup behavior does not imply continuous availability. Consumers need timeouts and failure handling after startup; actual restart behavior depends on orchestration policy.
Apply the concept
Draw the orders, inventory and stock graph, identify configuration wiring versus startup gating, and plan a database outage after startup. Then inspect the separate AppHost lab without running it.
Use the manual practice and knowledge check. Do not deploy or publish these fixtures.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Aspire development topology — knowledge check
Apply the lesson concepts to the following scenarios.
What does an AppHost primarily describe?
Which API is the new path-based choice in Aspire 17?
What is the role of WithReference?
What can WaitFor not guarantee?
Does adding a resource automatically configure all telemetry inside it?