.NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice
Styles
3-tier/N-layer (UI → BLL → DAL) · Onion/Clean/Hexagonal (domain centre, dependencies inward) · Vertical Slice (per feature) · Modular monolith (modules + schemas) · Microservices.
Clean Architecture projects
Domain (entities, value objects, events) ← Application (use cases, interfaces, DTOs, validation) ← Infrastructure (EF, email, files) ; Api = composition root (controllers, middleware, Program.cs).
Repo layout
src/ · tests/ · docs/ (ADRs) · deploy/ · Directory.Build.props · Directory.Packages.props · global.json · .editorconfig · .sln/.slnx.
Placement of concerns
Exceptions & auth → Api · validation & transactions & mapping → Application · invariants → Domain · persistence & external services → Infrastructure · logging → everywhere via ILogger.
Choosing
Small CRUD → simple single project · rich domain → Clean · many independent features → Vertical Slice · many teams → modular monolith · independent scaling/deploys → microservices · write an ADR, enforce with architecture tests.