How do you ensure that a new developer doesn't accidentally add a reference from the Domain project to the Infrastructure project? You use ArchUnit .NET.
ArchUnit allowed you to write tests that check the 'Design' of your application.
Types().That().ResideInNamespace("Domain").Should().NotDependOnAny(Types().InNamespace("Infrastructure")).
If anyone breaks this rule, the build fails. This is a massive improvement over traditional code reviews, where architectural slips can be easily missed.
You can also enforce conventions like "All Handlers must end with the word 'Handler'" or "All Domain Services must reside in the 'Services' folder". This keeps a large codebase consistent and predictably organized, which is vital for long-term maintenance.
Q: "Is this overkill?"
Architect Answer: "For a 2-person project? Maybe. For an enterprise project with 20 developers and 500,000 lines of code? NO. It's essential. It prevents 'Architectural Drift' where the project slowly decays into a monolith because someone took a shortcut. ArchUnit is your 'Architectural Sentry' that never sleeps."