<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/clean-architecture-in-one-project-gmzcu3ksq" -->

---
title: Clean Architecture in One Project | daily.dev
description: Clean Architecture doesn't require splitting a solution into many class libraries per layer. A single ASP.NET Core project, organized with namespace roots...
canonical: https://daily.dev/posts/clean-architecture-in-one-project-gmzcu3ksq
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Clean Architecture in One Project | daily.dev
og:description: Clean Architecture doesn't require splitting a solution into many class libraries per layer. A single ASP.NET Core project, organized with namespace roots...
og:url: https://daily.dev/posts/clean-architecture-in-one-project-gmzcu3ksq
og:image: https://api.daily.dev/og/posts/GMZCu3kSq.png
og:image:alt: Clean Architecture in One Project
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Clean Architecture in One Project

**[NikolaTech](https://daily.dev/sources/nikolatech)** · 3 min read · 0 upvotes · 0 comments

## Summary

Clean Architecture doesn't require splitting a solution into many class libraries per layer. A single ASP.NET Core project, organized with namespace roots mirroring the usual Domain, Business, Persistence, Infrastructure, and Presentation layers, can enforce the same dependency rules through discipline and tooling like NsDepCop or architecture tests. This single-project approach reduces boilerplate and speeds up early development, while still allowing migration to a multi-project solution later if the codebase grows and boundaries are already well defined.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nikolatech.net/blogs/clean-architecture-single-project>

## Questions this post answers

### Do I need separate class libraries for each layer to follow Clean Architecture in ASP.NET Core?

No, a single ASP.NET Core project can follow Clean Architecture by using namespace roots like WebApi.Domain, WebApi.Business, WebApi.Persistence, WebApi.Infrastructure, and WebApi.Presentation instead of separate .csproj files per layer. Separate projects physically prevent invalid references, which helps when multiple teams share a solution, but for many APIs that ceremony adds unnecessary complexity early on.

_daily.dev surfaces architecture debates like single-project versus multi-project Clean Architecture setups._

### How can I enforce Clean Architecture dependency rules without separate projects in .NET?

Use NsDepCop or architecture tests to enforce namespace dependency rules at build time. Adding a config.nsdepcop file lets a Roslyn analyzer declare which namespace bands may reference each other, so an introduced forbidden using statement fails the build instead of only being caught during code review.

_Developers enforcing architectural boundaries in .NET can track tooling approaches like this on daily.dev._

## Similar posts on daily.dev

- [Creating a Production-Ready CRUD Application in ASP.NET Core](https://daily.dev/posts/creating-a-production-ready-crud-application-in-asp-net-core-1mfpkrepl) · Telerik · 0 upvotes · 0 comments
- [Clean Architecture Explained: Building Software That Stands the Test of Time](https://daily.dev/posts/clean-architecture-explained-building-software-that-stands-the-test-of-time-acdblphuf) · Medium · 1 upvotes · 0 comments
- [Clean Architecture with .NET: Book Review](https://daily.dev/posts/clean-architecture-with-net-book-review-f23iix68h) · We Are .NET · 5 upvotes · 0 comments
- [5 Architecture Tests You Should Add to Your .NET Projects](https://daily.dev/posts/5-architecture-tests-you-should-add-to-your-net-projects-srtuu4tjc) · Milan Jovanović · 20 upvotes · 0 comments
- [Layered Architecture for Building Readable, Robust, and Extensible Apps](https://daily.dev/posts/layered-architecture-for-building-readable-robust-and-extensible-apps-ca78tav68) · Towards Data Science · 0 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#.net](https://daily.dev/tags/.net), [#c#](https://daily.dev/tags/c#), [#aspnet](https://daily.dev/tags/aspnet)

[View this post on daily.dev](https://daily.dev/posts/clean-architecture-in-one-project-gmzcu3ksq)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Clean Architecture in One Project","url":"https://daily.dev/posts/clean-architecture-in-one-project-gmzcu3ksq","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/clean-architecture-in-one-project-gmzcu3ksq"},"datePublished":"2026-10-04T13:07:40.056Z","dateModified":"2026-10-04T13:17:58.655Z","description":"Clean Architecture doesn't require splitting a solution into many class libraries per layer. A single ASP.NET Core project, organized with namespace roots...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6d93ab543166c6d8612b3dc75bc46e45?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6d93ab543166c6d8612b3dc75bc46e45?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"NikolaTech","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"NikolaTech","logo":"https://media.daily.dev/image/upload/s--1h2fO6FL--/f_auto,q_auto/v1791119050/logos/nikolatech?_a=BAMAMicg0","url":"https://daily.dev/sources/nikolatech"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/clean-architecture-in-one-project-gmzcu3ksq","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,.net,c#,aspnet","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"NikolaTech","item":"https://daily.dev/sources/nikolatech"},{"@type":"ListItem","position":3,"name":"Clean Architecture in One Project"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/clean-architecture-in-one-project-gmzcu3ksq#faq","mainEntity":[{"@type":"Question","name":"Do I need separate class libraries for each layer to follow Clean Architecture in ASP.NET Core?","acceptedAnswer":{"@type":"Answer","text":"No, a single ASP.NET Core project can follow Clean Architecture by using namespace roots like WebApi.Domain, WebApi.Business, WebApi.Persistence, WebApi.Infrastructure, and WebApi.Presentation instead of separate .csproj files per layer. Separate projects physically prevent invalid references, which helps when multiple teams share a solution, but for many APIs that ceremony adds unnecessary complexity early on. daily.dev surfaces architecture debates like single-project versus multi-project Clean Architecture setups."}},{"@type":"Question","name":"How can I enforce Clean Architecture dependency rules without separate projects in .NET?","acceptedAnswer":{"@type":"Answer","text":"Use NsDepCop or architecture tests to enforce namespace dependency rules at build time. Adding a config.nsdepcop file lets a Roslyn analyzer declare which namespace bands may reference each other, so an introduced forbidden using statement fails the build instead of only being caught during code review. Developers enforcing architectural boundaries in .NET can track tooling approaches like this on daily.dev."}}]}
```

