A .NET 10 API template built around vertical slice architecture and orchestrated with .NET Aspire. The Aspire AppHost wires the API together with its supporting infrastructure — SQL Server, Redis, and Seq — so you can run the whole system locally with a single command.
| Project | Description |
|---|---|
src/VerticalSliceTemplate.AppHost |
Aspire orchestrator and local run entry point. Provisions SQL Server, Redis and Seq containers and launches the API. |
src/VerticalSliceTemplate.Api |
ASP.NET Core API organized into vertical slices, with API documentation exposed via Scalar. |
src/VerticalSliceTemplate.ServiceDefaults |
Shared Aspire service defaults (telemetry, health checks, resilience). |
tests/VerticalSliceTemplate.Api.Tests |
Unit tests. |
tests/VerticalSliceTemplate.Api.Integration.Tests |
Integration tests. |
- .NET 10 SDK
- A running container runtime — Docker Desktop or a compatible alternative. The AppHost starts SQL Server, Redis, and Seq as containers, so the runtime must be running before you start the app.
Trust the ASP.NET Core development HTTPS certificate (required for the https profile):
dotnet dev-certs https --trustThe SQL Server password is supplied by the
sqlPasswordparameter, which already has a default value insrc/VerticalSliceTemplate.AppHost/appsettings.json. No additional configuration is required to run locally. If you want to override it, set a user secret on the AppHost project:dotnet user-secrets --project src/VerticalSliceTemplate.AppHost set "Parameters:sqlPassword" "<your-password>"
From the repository root, run the AppHost using the https launch profile:
dotnet run --project src/VerticalSliceTemplate.AppHost --launch-profile httpsThis will:
- Start the SQL Server, Redis, and Seq containers.
- Start the API.
- Open the Aspire dashboard at https://localhost:17178.
From the dashboard you can view each resource, its logs, and its endpoints. Open the
API's Scalar UI link (served at /scalar on the API's HTTPS endpoint) to explore and
call the API.
Using an IDE? Set
VerticalSliceTemplate.AppHostas the startup project, select the https launch profile, and start debugging — this is equivalent to the command above.
dotnet test- Containers won't start / connection errors: ensure Docker Desktop (or your container runtime) is running before launching the AppHost.
- HTTPS/certificate warnings: run
dotnet dev-certs https --trustand restart your browser. - Persistent containers: SQL Server, Redis, and Seq are configured with a persistent lifetime, so their data survives restarts. Remove the containers manually if you need a clean state.
- Ports in use: the local endpoints use fixed ports (dashboard
17178, Seq8002, SQL Server8003, Redis8004). Free these ports or update the configuration if they conflict with other services.