Roadmap › 1. .NET › Step 25
Arc

.NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice

How real .NET solutions are organised — solution and project structure, 3-tier and N-layer architecture, Onion, Hexagonal (ports and adapters) and Clean Architecture, Vertical Slice architecture, modular monolith, DDD building blocks, CQRS, the folder structure of each style with naming conventions, shared build settings (Directory.Build.props, central package management), test projects, where cross-cutting concerns live, and how to choose an architecture.
Quick revision for interview day. Print it or save it as a PDF.

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.