CleanArchitecture.Aspire.Template 1.9.1

dotnet new install CleanArchitecture.Aspire.Template@1.9.1
                    
This package contains a .NET Template Package you can call from the shell/command line.

Clean Architecture Template with Aspire

A flexible, production-ready .NET template implementing Clean Architecture with optional Aspire orchestration, CQRS, DDD, three database providers, optional JWT Authentication, front-end options (React/Angular/Blazor), Health Checks, OpenTelemetry, Serilog, Docker Compose, Azure deployment, and architecture tests.

Every wizard option is implemented and verified. Before each release, scripts/smoke-test.sh packs the template, installs it into an isolated hive, generates 32 different option combinations, and builds every one of them. See Verification.

๐Ÿ“‹ Template Wizard Preview

When creating a new project, the wizard lets you configure all options in one place:

Template Wizard - Additional Information

Configure Framework, Aspire, Authentication, Example Features, Migrations, Seed Data, OpenTelemetry, Health Checks, Logging, Client Framework (React/Angular/Blazor), API Style, Docker, Tests, Database Provider, and Deployment Profile.

๐Ÿš€ Quick Start

Install from NuGet

dotnet new install CleanArchitecture.Aspire.Template

Create a New Project

Via Command Line:

dotnet new cleanarch-aspire -n YourProjectName

View all options:

dotnet new cleanarch-aspire -h

Via Visual Studio:

  1. Open Visual Studio
  2. Click "Create a new project"
  3. Search for "Clean Architecture" or "Aspire"
  4. Select "Clean Architecture Template with Aspire"
  5. Follow the wizard to configure options
  6. Click "Create"

๐Ÿ“ฆ What's Included

Architecture Layers

  • SharedKernel: Common abstractions and base classes
  • Domain: Domain entities, value objects, and domain events
  • Application: Use cases, CQRS handlers, and application logic
  • Infrastructure: Data access, external services, and infrastructure concerns
  • Web.Api: API endpoints, controllers, and presentation logic

Features

โœ… Clean Architecture - Separation of concerns with clear boundaries
โœ… CQRS - Command Query Responsibility Segregation pattern
โœ… DDD - Domain-Driven Design principles
โœ… Aspire (optional) - .NET Aspire 13 for cloud-native orchestration
โœ… Three database providers - PostgreSQL, SQL Server, or SQLite, each with its own EF Core migrations
โœ… Multi-targeting - .NET 10, .NET 9, or .NET 8, each with a matching package set
โœ… JWT Authentication (optional) - Access tokens with rotating refresh tokens
โœ… Permission-based Authorization - Fine-grained access control
โœ… Refresh Tokens - Short-lived access tokens (15 min) + long-lived refresh tokens (7 days), stored in Redis or memory, rotated on refresh, single-use
โœ… Rate Limiting - Sliding-window rate limiter (100 req/min per IP), HTTP 429 on exceed
โœ… Redis (optional) - Distributed caching and refresh token storage when Aspire is selected
โœ… Serilog (optional) - Structured logging to Console, plus Seq when Aspire is selected
โœ… Health Checks (optional) - Application and provider-specific database health monitoring
โœ… OpenTelemetry (optional) - Distributed tracing and metrics
โœ… Sentry (optional) - Error monitoring, logs, metrics, tracing across API and frontends
โœ… Seed Data (optional) - Idempotent demo user + todo items
โœ… Swagger/OpenAPI - API documentation with Bearer token support
โœ… Minimal APIs or Controllers - Your choice of endpoint style
โœ… Docker + Docker Compose - Dockerfile plus a compose file wired to your chosen database, Redis, and Seq
โœ… Azure deployment (optional) - Bicep infrastructure (Container Apps, ACR, Log Analytics, managed database) + azure.yaml for azd
โœ… Architecture Tests - Automated architecture validation
โœ… Central Package Management - Centralized NuGet version control
โœ… Code Analysis - SonarAnalyzer integration
โœ… React & Angular (.esproj) - JavaScript Project System for Solution Explorer (VS 2022/2026)

Project Structure

YourProjectName/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ SharedKernel/           # Shared abstractions
โ”‚   โ”œโ”€โ”€ Domain/                 # Domain layer
โ”‚   โ”œโ”€โ”€ Application/            # Application layer (CQRS)
โ”‚   โ”œโ”€โ”€ Infrastructure/         # Infrastructure layer
โ”‚   โ”‚   โ””โ”€โ”€ Database/Migrations/  # Migrations for your chosen provider
โ”‚   โ”œโ”€โ”€ Web.Api/                # API layer
โ”‚   โ”œโ”€โ”€ Aspire.AppHost/         # Aspire orchestration (IncludeAspire=true)
โ”‚   โ”œโ”€โ”€ Aspire.ServiceDefaults/ # Aspire service defaults (IncludeAspire=true)
โ”‚   โ”œโ”€โ”€ Web.Client.React/       # React SPA (ClientFramework=React)
โ”‚   โ”œโ”€โ”€ Web.Client.Angular/     # Angular SPA (ClientFramework=Angular)
โ”‚   โ””โ”€โ”€ Web.Client.Blazor/      # Blazor WASM (ClientFramework=Blazor)
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ YourProjectNameTests/   # Architecture validation tests
โ”œโ”€โ”€ infra/                      # Bicep infrastructure (DeploymentProfile=Azure)
โ”œโ”€โ”€ azure.yaml                  # azd config (DeploymentProfile=Azure)
โ”œโ”€โ”€ docker-compose.yml          # Local orchestration (IncludeDockerCompose=true)
โ”œโ”€โ”€ Directory.Build.props       # Common build properties
โ”œโ”€โ”€ Directory.Packages.props    # Central package management
โ””โ”€โ”€ YourProjectName.sln

โš™๏ธ Configuration Options

Option CLI Parameter Values Default Description
Project Name -n, --name Any string Current directory Your project name (PascalCase recommended)
Framework -F, --Framework net10.0, net9.0, net8.0 net10.0 Target framework. Package versions are selected to match.
Include Aspire --IncludeAspire true, false true Aspire orchestration (AppHost, ServiceDefaults, Dashboard). Use false for API-only.
Include Authentication --IncludeAuthentication true, false true JWT Authentication and permission-based Authorization. Excludes Users domain when false.
Include Example Features --IncludeExampleFeatures true, false true Sample Todos and Users features
Apply Migrations on Startup --ApplyMigrationsOnStartup true, false true Auto-apply EF migrations in Development
Include Seed Data --IncludeSeedData true, false false Demo user + todo items. Requires Example Features and Authentication.
Include OpenTelemetry --IncludeOpenTelemetry true, false true Tracing and metrics in ServiceDefaults. Applies when Aspire is selected.
Include Health Checks --IncludeHealthChecks true, false true /health endpoint + provider-specific database check
Include Sentry --IncludeSentry true, false false Sentry error monitoring. Configures Web.Api and the selected frontend.
Sentry: Include Logs --IncludeSentryLogs true, false false Send ILogger logs to Sentry. Requires IncludeSentry.
Sentry: Include Metrics --IncludeSentryMetrics true, false false Enable Sentry metrics. Requires IncludeSentry.
Sentry: Include Tracing --IncludeSentryTracing true, false false Enable Sentry performance tracing. Requires IncludeSentry.
Logging Stack --LoggingStack Default, Serilog Default Serilog adds Console logging, plus a Seq container when Aspire is selected.
Client Framework --ClientFramework None, React, Angular, Blazor None Front-end (API only by default)
Frontend dev server in Aspire --IncludeFrontendInAspire true, false false The AppHost runs the React/Angular dev server, so one F5 starts everything with hot reload. Requires Aspire + React or Angular. Takes precedence over Frontend in Docker.
Frontend in Docker (Aspire) --IncludeFrontendInDocker true, false false Run the frontend as a production container orchestrated by Aspire (nginx, no hot reload). Requires Aspire + a frontend.
Include Redis --IncludeRedis true, false false Distributed cache + refresh token store. Requires Aspire.
API Style --ApiStyle MinimalApis, Controllers MinimalApis API endpoint style
Include Docker -I, --IncludeDocker true, false true Dockerfile and .dockerignore
Include Docker Compose --IncludeDockerCompose true, false true docker-compose.yml wired to your database, Redis, and Seq
Include Tests -In, --IncludeTests true, false true Architecture tests project
Database Provider -D, --DatabaseProvider PostgreSQL, SQLServer, SQLite PostgreSQL Provider, EF packages, migrations, and health check all follow this choice
Deployment Profile --DeploymentProfile LocalOnly, Docker, Azure LocalOnly Azure adds Bicep infrastructure and azure.yaml for azd

Wizard consistency: Options that don't apply are excluded automatically. Redis and OpenTelemetry only take effect with Aspire; seed data requires Example Features + Authentication; frontend Dockerfiles require Aspire + a frontend. The generated solution contains only the files your configuration needs.

Examples

# Defaults (.NET 10, PostgreSQL, Aspire, Docker, Tests, Minimal APIs)
dotnet new cleanarch-aspire -n MyAwesomeProject

# Target .NET 9 or .NET 8 (package versions follow automatically)
dotnet new cleanarch-aspire -n MyProject --Framework net9.0
dotnet new cleanarch-aspire -n MyProject --Framework net8.0

# API-only, no orchestration
dotnet new cleanarch-aspire -n MyProject --IncludeAspire false

# SQL Server or SQLite (provider-specific migrations are generated)
dotnet new cleanarch-aspire -n MyProject --DatabaseProvider SQLServer
dotnet new cleanarch-aspire -n MyProject --DatabaseProvider SQLite

# Front-ends
dotnet new cleanarch-aspire -n MyProject --ClientFramework React
dotnet new cleanarch-aspire -n MyProject --ClientFramework Angular
dotnet new cleanarch-aspire -n MyProject --ClientFramework Blazor

# Aspire runs the React dev server: one F5 starts database, API and React (hot reload)
dotnet new cleanarch-aspire -n MyProject --ClientFramework React --IncludeFrontendInAspire true
dotnet new cleanarch-aspire -n MyProject --ClientFramework Angular --IncludeFrontendInAspire true

# React as a Docker container orchestrated by Aspire (production build, no hot reload)
dotnet new cleanarch-aspire -n MyProject --ClientFramework React --IncludeFrontendInDocker true

# Redis distributed cache (Aspire)
dotnet new cleanarch-aspire -n MyProject --IncludeRedis true

# Serilog structured logging (adds Seq under Aspire)
dotnet new cleanarch-aspire -n MyProject --LoggingStack Serilog

# Controllers instead of Minimal APIs
dotnet new cleanarch-aspire -n MyProject --ApiStyle Controllers

# Demo seed data (demo@example.com / Demo123!)
dotnet new cleanarch-aspire -n MyProject --IncludeSeedData true

# Azure-ready: Bicep infrastructure + azd config
dotnet new cleanarch-aspire -n MyProject --DeploymentProfile Azure

# No authentication (excludes Users domain; Todos become unauthenticated)
dotnet new cleanarch-aspire -n MyProject --IncludeAuthentication false

# Empty skeleton (no example features)
dotnet new cleanarch-aspire -n MyProject --IncludeExampleFeatures false

# Lean API: no Aspire, no auth, SQLite
dotnet new cleanarch-aspire -n MyProject --IncludeAspire false --IncludeAuthentication false --DatabaseProvider SQLite

# Sentry with everything enabled
dotnet new cleanarch-aspire -n MyProject --IncludeSentry true --IncludeSentryLogs true --IncludeSentryMetrics true --IncludeSentryTracing true --ClientFramework React

๐Ÿ“– Feature Guide

Feature What it does When to use
Framework Sets the target framework for every project and selects a matching package set (EF Core, ASP.NET Core, Aspire, OpenTelemetry). net10.0 for new work; net9.0/net8.0 when your hosting environment requires it.
Include Aspire Adds AppHost + ServiceDefaults, orchestrates your database container, Redis, and Seq, and injects connection strings. true for cloud-native apps and the Aspire dashboard. false for a plain API.
Include Authentication JWT auth with rotating refresh tokens, permission-based authorization, and the Users feature. Access tokens expire in 15 min, refresh tokens in 7 days. true for apps with login. false produces an API with no auth and no Users domain.
Include Example Features Todos and Users CRUD (domain, handlers, endpoints, migrations). true to learn the structure. false for a clean skeleton with an empty-schema migration.
Apply Migrations on Startup Features:ApplyMigrationsOnStartup โ€“ applies EF migrations in Development, with retries. true for local convenience. false to run migrations manually.
Include Seed Data Registers DatabaseSeeder and runs it at startup when Features:IncludeSeedData is true. Idempotent; creates demo@example.com / Demo123!. Local development and demos. Never enable in production.
Include OpenTelemetry ASP.NET Core, HTTP, runtime, and EF Core instrumentation wired into ServiceDefaults, exported over OTLP. When you want traces and metrics in the Aspire dashboard or an OTLP backend.
Include Health Checks /health with a provider-specific database check, plus /alive under Aspire. Container orchestration and uptime monitoring.
Include Sentry Sentry SDK for Web.Api plus the selected frontend, with a demo endpoint and UI. Production error tracking.
Logging Stack Default = built-in logging. Serilog = structured logging from appsettings.json, Console sink, plus a Seq container and sink under Aspire. Choose Serilog when you want structured logs and Seq.
Client Framework React (Vite 8 + React 19), Angular (v20), Blazor (WebAssembly), or None. Pick your front-end stack.
Frontend dev server in Aspire Registers the React/Angular dev server as an Aspire resource via Aspire.Hosting.JavaScript. Aspire installs npm packages, passes --port, injects the API address, and shows the app in the dashboard. Hot reload is preserved. You want a single startup project that runs the whole stack.
Frontend in Docker (Aspire) Builds the frontend from a root Dockerfile and registers it in AppHost, served by nginx. โš ๏ธ No hot reload โ€“ assets are built once. Containerized frontend, production-like.
API Style MinimalApis = endpoint classes discovered by reflection. Controllers = MVC controllers. Minimal APIs for modern style; Controllers for familiarity.
Include Redis IDistributedCache via Redis and Redis-backed refresh tokens; adds a Redis health check. Requires Aspire. Caching, session storage, refresh tokens across instances.
Include Docker Compose docker-compose.yml with the API plus your database, and Redis/Seq when selected, with health-check gating. Running the whole stack locally without Aspire.
Deployment Profile Azure adds infra/main.bicep + infra/resources.bicep (Container Apps, ACR, managed identity, Log Analytics, PostgreSQL/Azure SQL) and azure.yaml for azd up. Deploying to Azure Container Apps.
Database Provider Selects EF provider packages, provider-specific migrations, health check, schema (public/dbo/none), and container image. PostgreSQL for production; SQLite for zero-setup local dev.

๐Ÿ› ๏ธ Getting Started After Creation

  1. Restore dependencies:

    dotnet restore
    
  2. Configure secrets in src/Web.Api/appsettings.json (or User Secrets):

    • Connection string: ConnectionStrings:Database โ€” already filled in for Development
    • JWT secret: a unique development secret is generated into appsettings.Development.json for every new project. For production, set your own:
      dotnet user-secrets set "Jwt:Secret" "your-secret-key" --project src/Web.Api
      
      (use at least 32 characters)
  3. Run migrations (only needed when ApplyMigrationsOnStartup=false):

    dotnet ef database update --project src/Infrastructure --startup-project src/Web.Api
    
  4. Run the application:

Your choices How to run What starts
Aspire + API only dotnet run --project src/Aspire.AppHost API (5000), Dashboard, database container
Aspire + Redis / Serilog dotnet run --project src/Aspire.AppHost Adds Redis (6379) and/or Seq
Aspire + Blazor 1. dotnet run --project src/Aspire.AppHost<br>2. dotnet run --project src/Web.Client.Blazor API + Blazor (5002) with CORS
Aspire + React 1. dotnet run --project src/Aspire.AppHost<br>2. cd src/Web.Client.React && npm install && npm run dev API + React dev server (5173) with proxy
Aspire runs the frontend (IncludeFrontendInAspire=true) dotnet run --project src/Aspire.AppHost API + React/Angular dev server, one command, hot reload kept
Aspire + Angular 1. dotnet run --project src/Aspire.AppHost<br>2. cd src/Web.Client.Angular && npm install && npm start API + Angular dev server (4200) with proxy
Aspire + frontend in Docker dotnet run --project src/Aspire.AppHost API + frontend container, single command
No Aspire + API only dotnet run --project src/Web.Api API only (5000)
No Aspire + frontend Run src/Web.Api, then the client project / npm run dev / npm start API + frontend with CORS or proxy
Docker Compose docker compose up --build API + database (+ Redis/Seq when selected)

โš ๏ธ Hot reload does not work with IncludeFrontendInDocker=true. The frontend runs as a production container (static assets via nginx). Use false and a local dev server for hot reload.

  1. Access the application:
    • API: http://localhost:5000
    • Swagger UI: http://localhost:5000/swagger
    • Aspire Dashboard: printed in the console on startup (IncludeAspire=true)
    • Blazor: http://localhost:5002 ยท React: http://localhost:5173 ยท Angular: http://localhost:4200
    • Seq (Serilog + Aspire): http://localhost:5341

Visual Studio / Rider Launch Profiles

  • Aspire only: Set startup project to Aspire.AppHost.
  • Aspire + frontend: Solution โ†’ Properties โ†’ Multiple startup projects โ†’ Aspire.AppHost + your client.
  • No Aspire: Set startup project to Web.Api.

VS Code Launch Profiles

.vscode/launch.json includes individual configurations (Web.Api, each client, Aspire AppHost) and compound ones (API + Blazor/React/Angular, Aspire + Blazor/React/Angular).

Default Ports

Service Port When
Web.Api (HTTP / HTTPS) 5000 / 5001 Always
Redis 6379 IncludeRedis=true (Aspire)
Seq 5341 LoggingStack=Serilog
React (Vite) 5173 ClientFramework=React
Angular 4200 ClientFramework=Angular
Blazor WASM 5002 / 5003 ClientFramework=Blazor

Config-driven ports (Aspire): ports come from src/Aspire.AppHost/appsettings.json (Api:HttpPort, Api:HttpsPort, Frontend:BlazorPort, โ€ฆ). Override with Api__HttpPort, Frontend__BlazorPort, etc. Web.Api's launchSettings.json is not used in that case.

๐Ÿ“š Architecture Concepts

Clean Architecture

  • Domain Layer: Core business logic, independent of infrastructure
  • Application Layer: Use cases and application logic (CQRS)
  • Infrastructure Layer: External concerns (database, authentication, caching)
  • Presentation Layer: API endpoints and controllers

CQRS Pattern

Commands modify state, queries read data, handlers process them, and FluentValidation validates input through a decorator.

Domain Events

Domain events are raised by entities, collected on SaveChangesAsync, and dispatched to handlers in the Application layer.

Result Pattern

Type-safe error handling with no exceptions for business logic. Error carries an ErrorType that maps to HTTP status codes:

ErrorType HTTP status
Validation, Problem 400
Unauthorized 401
Forbidden 403
NotFound 404
Conflict 409
Failure 500

๐Ÿ”ง Configuration

Environment Variables

  • ASPNETCORE_ENVIRONMENT: Development, Staging, Production
  • ConnectionStrings__Database: Database connection string
  • ConnectionStrings__cache: Redis connection string (injected by Aspire when IncludeRedis=true)
  • Jwt__Secret, Jwt__Issuer, Jwt__Audience
  • Jwt__ExpirationInMinutes (default 15), Jwt__RefreshTokenExpirationInDays (default 7)
  • Jwt__RequireHttpsMetadata: defaults to true; the generated appsettings.Development.json sets it to false for local HTTP

Features Section

{
  "Features": {
    "IncludeAuthentication": true,
    "ApplyMigrationsOnStartup": true,
    "IncludeSeedData": false
  }
}

These values are written from your wizard selections.

โš™๏ธ Feature Details

Database Providers

Each provider gets its own EF Core migrations, health check, and schema convention:

Provider Packages Schema Local default
PostgreSQL Npgsql.EntityFrameworkCore.PostgreSQL, AspNetCore.HealthChecks.NpgSql public Host=localhost;Port=5432;Database=<project>;Username=postgres;Password=postgres
SQL Server Microsoft.EntityFrameworkCore.SqlServer, AspNetCore.HealthChecks.SqlServer dbo Server=(localdb)\MSSQLLocalDB;Database=<project>;Integrated Security=true
SQLite Microsoft.EntityFrameworkCore.Sqlite, AspNetCore.HealthChecks.Sqlite none Data Source=<project>.db

Under Aspire, PostgreSQL and SQL Server run as containers and the connection string is injected automatically. SQLite needs no container.

JWT Authentication & Refresh Tokens

  • Access token: short-lived (default 15 min), sent as Authorization: Bearer <token>.
  • Refresh token: long-lived (default 7 days), single-use, rotated on every refresh.
  • Endpoints: POST /api/users/login returns { accessToken, refreshToken, expiresAt }; POST /api/users/refresh exchanges a refresh token for a new pair. A consumed or unknown refresh token returns 401.
  • Storage: keep the access token in memory and the refresh token in an HttpOnly cookie or secure storage โ€” never localStorage.
  • Server-side store: Redis when IncludeRedis=true, otherwise an in-memory distributed cache.
  • HTTPS metadata: Jwt:RequireHttpsMetadata defaults to true; only Development turns it off.

Rate Limiting

Sliding window, 100 requests per minute per IP, HTTP 429 on exceed. Configure in Program.cs via AddRateLimiter().

Redis

  • With Aspire: Redis runs as a container and ConnectionStrings:cache is injected via WithReference(cache).
  • Inject IDistributedCache in your services:
public class MyService(IDistributedCache cache)
{
    public Task<string?> GetCachedAsync(string key, CancellationToken ct) =>
        cache.GetStringAsync(key, ct);
}

Serilog

LoggingStack=Serilog configures Serilog from the Serilog section of appsettings.json (Console sink, FromLogContext/WithMachineName/WithThreadId enrichers). With Aspire, a Seq container is added and its URL is injected into the Seq sink; browse logs at http://localhost:5341.

Seed Data

IncludeSeedData=true registers DatabaseSeeder and runs it after migrations when Features:IncludeSeedData is true. It creates demo@example.com with password Demo123! and two todo items, and does nothing if the demo user already exists. Seeding failures are logged and never block startup.

Azure Deployment

DeploymentProfile=Azure adds:

  • infra/main.bicep โ€” subscription-scoped deployment creating the resource group
  • infra/resources.bicep โ€” Container Apps environment, Container Registry, user-assigned identity with AcrPull, Log Analytics, and a managed database (PostgreSQL Flexible Server or Azure SQL; SQLite runs in-container)
  • azure.yaml โ€” azd configuration
azd auth login
azd up

The JWT secret and database connection string are provisioned as Container App secrets.

Sentry

Sentry provides error monitoring, tracing, logs, and metrics for Web.Api and all frontends.

Layer When What you get
Web.Api IncludeSentry=true Sentry.AspNetCore, UseSentry(), appsettings config, GET /api/sentry/demo
Blazor + ClientFramework=Blazor Sentry.AspNetCore.Blazor.WebAssembly, UseSentry(), SentryDemo component
React + ClientFramework=React @sentry/react, instrument.ts, ErrorBoundary, replay, trace propagation
Angular + ClientFramework=Angular @sentry/angular, sentry.ts, ErrorHandler, TraceService

Setup: create a project at sentry.io, copy the DSN, then:

dotnet user-secrets set "Sentry:Dsn" "your-dsn" --project src/Web.Api
  • Blazor: src/Web.Client.Blazor/wwwroot/appsettings.json โ†’ Sentry:Dsn
  • React: copy .env.example to .env.local, set VITE_SENTRY_DSN
  • Angular: set the dsn in src/app/sentry.ts

Call GET /api/sentry/demo or use the Sentry demo buttons on the frontend Home page to verify.

๐Ÿงช Testing

Run architecture tests:

dotnet test

๐Ÿ”ฌ Verification

This repository verifies the template end to end rather than relying on inspection:

./scripts/smoke-test.sh            # full matrix
./scripts/smoke-test.sh Default Net8 Sqlite   # selected cases

The script packs the template, installs it into an isolated dotnet new hive, generates 29 option combinations (each framework, each database provider, each API style, each frontend, auth on/off, Serilog, Redis, seeding, Azure, and several combined configurations), checks that no template placeholder survived substitution, and builds every generated solution. It exits non-zero if anything fails. Run it before publishing a new version.

๐Ÿณ Docker

docker compose up --build

The compose file is generated for your configuration: the API plus PostgreSQL/SQL Server (with health-check gating) or a SQLite volume, plus Redis and Seq when selected.

๐Ÿ“ Uninstalling the Template

dotnet new uninstall CleanArchitecture.Aspire.Template

๐Ÿ” Troubleshooting

Template Not Found

  1. Verify the installation command completed successfully
  2. Run dotnet new list to confirm it is installed
  3. Check your SDK version: dotnet --version (.NET 10 SDK recommended)

Build Errors

  1. Ensure the SDK for your chosen --Framework is installed
  2. Run dotnet restore
  3. NuGet security advisories (NU1901โ€“NU1904) are reported as warnings, not errors, so a newly disclosed CVE in a transitive package cannot break your build. Review and update them at your own pace.

Database Connection Issues

  1. Make sure the database is running (or use Aspire / Docker Compose, which start it for you)
  2. Verify ConnectionStrings:Database
  3. SQLite needs no server โ€” the file is created next to the API

Aspire / Port Conflicts

  1. Free the default ports (5000/5001) or edit src/Aspire.AppHost/appsettings.json:
    { "Api": { "HttpPort": 5000, "HttpsPort": 5001 },
      "Frontend": { "BlazorPort": 5002, "ReactPort": 5173, "AngularPort": 4200 } }
    
  2. Override with env vars: Api__HttpPort, Frontend__BlazorPort, โ€ฆ
  3. When running via Aspire, Web.Api's launchSettings.json is not used.

CORS / API Connection

  • CORS is configured for React (5173), Angular (4200), and Blazor (5002/5003) whenever a frontend is selected. If you change ports, update the CORS policy in Program.cs.
  • 404 on /api: start the API before the frontend.
  • Proxy issues: check vite.config.ts (React) or proxy.conf.json (Angular) โ€” both target http://localhost:5000.

Frontend Projects in Solution Explorer

React and Angular use the JavaScript Project System (.esproj) and require the Node.js development workload in Visual Studio. If they don't appear: refresh Solution Explorer, clear any filter, reload the project, or use Add โ†’ Existing Project and pick src/Web.Client.React/Web.Client.React.esproj.

Authentication / JWT

  • IDX10703 / "key length is zero": Jwt:Secret is empty. New projects get a generated development secret; set your own for production via User Secrets.
  • 401 on protected endpoints: check that the access token has not expired (15 min) and that Jwt:Issuer/Jwt:Audience match.
  • 401 from /api/users/refresh: refresh tokens are single-use โ€” use the newest one returned by the last refresh.

Migrations Not Applied

  • Ensure Features:ApplyMigrationsOnStartup is true and the app runs in Development.
  • Migrations are skipped when ConnectionStrings:Database is empty.

๐Ÿ“„ License

PROPRIETARY LICENSE

Copyright (c) 2026 Rebrandsoft. All Rights Reserved.

This software is proprietary and confidential. Unauthorized copying, modification, distribution, or use is strictly prohibited. See LICENSE file for full terms.

ATTRIBUTION REQUIRED: If you use this template, you must include prominent attribution to Rebrandsoft as the original author.

๐Ÿ™ Acknowledgments

  • Inspired by Clean Architecture principles
  • Built with .NET Aspire
  • Uses FluentValidation, Scrutor, Serilog, and other excellent libraries

๐Ÿ“ž Support

๐Ÿ“š Additional Resources


Made with โค๏ธ by Rebrandsoft

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.9.1 195 8/20/2026
1.9.0 137 8/18/2026
1.8.2 154 8/18/2026
1.8.1 154 8/12/2026
1.8.0 158 8/12/2026
Loading failed