10 Opinions For Creating More Maintainable .NET Apps
summary
Ten concrete practices for maintainable .NET apps: use feature folders to co‑locate controllers, views and assets; flip TreatWarningsAsErrors for new projects; use Serilog via the ILogger abstraction and structured logs (include version, correlation id); store audits in the transactional DB not in logs; prefer FluentValidation over data annotations; remove the Kestrel Server header; avoid injecting IOptions<T> (register T.Value); expose a version file endpoint; enable ValidateOnBuild for DI errors; adopt build once deploy many times — one client moves from 12 to ~2000 deployments/year with <1% rollbacks.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 3:36Group by feature not layers
- 8:35Compiler warnings as errors
- 10:23Logging best practices
- 18:30Authorization with fallback policies
- 20:36Fluent Validation over Data Annotations
- 23:49Remove Server header
- 25:39Avoid IOptions
- 28:09Version endpoint
- 31:16Refactor with early returns
- 34:51HTTP security headers
- 37:20Build once deploy many
- 39:48Validate IoC on build
- 41:53Maintainable automated tests
- 46:28Central Package Management
- 49:17Debug EF SQL queries
- 50:40Continuous deployment
- 54:59Q&A








