.NET Clean Architecture Template

A dotnet new template with the Clean Architecture layers already wired.

Role
Author
Started
June 2024
Language
C#
Platform
Cross-platform

Starting a Clean Architecture solution means recreating the same five projects, the same reference rules between them, and the same dependency-injection wiring every time — before writing a line of behaviour.

This is that setup as a dotnet new template. Install it once with dotnet new install, then dotnet new mbtemplate -n YourProject produces a solution with API, Application, Domain, Infrastructure and Persistence layers already in place and correctly referenced.

It is intentionally a template rather than a framework or a NuGet dependency: the generated code is yours to change. Nothing is hidden behind a package you would have to fight when your architecture stops matching the default.

  • Five wired layers: API, Application, Domain, Infrastructure, Persistence
  • Installs into the .NET CLI as a first-class dotnet new template
  • Correct project references and DI wiring from the first build
  • Generated code is fully owned by you — no framework dependency
  • Scaffolds a runnable Web API solution in one command
  • .NET
  • C#

← All projects