To start the Kladde, you have needed several steps so far: start SQL Server in a container, apply migrations with dotnet ef, start
Kladde.Web with dotnet run, and when something is slow, search the log. Aspire puts that together. You describe the whole
application once in C#, in a project of its own, the AppHost. One command then starts everything in the right order and opens a
dashboard where you see the logs, traces and metrics of all parts.
In lesson 2.9.5, the same description is the basis for delivery to Azure. So what you write into the AppHost today also decides what is created there.
What Aspire is
Aspire has three parts:
- The AppHost is a small C# program that describes the application's resources: containers like SQL Server, databases, your projects, and who depends on whom. It runs only during development and as a template for delivery, never in production itself.
- The ServiceDefaults are a shared project that every app in the solution includes. It sets up OpenTelemetry, health checks and service discovery.
- The dashboard shows what the resources are doing: their state, their console output, structured logs, traces and metrics.
The course uses Aspire 13; at the time of this lesson, the packages have version 13.6.4. Aspire needs the .NET 10 SDK and a container runtime, Docker Desktop or Podman.
In the codespace: Aspire starts containers and then talks to them directly. The Kladde's devcontainer from lesson 2.4.1 isn't set up for that, because its containers run next to the working container. So work through this lesson and the next ones on your own computer. If all you have is a codespace, you'll find a suitable template for a codespace of your own in the guide “Aspire in GitHub Codespaces” under “Further reading”.