Skip to content

.NET / ASP.NET Core checklist

Copy this list into a pull request, design review or project kickoff and tick what applies. Rules are grouped by level and sorted by score (criteria). Each links to the file that explains it and cites its sources. Automatable names tools that can check the rule in CI (see the file's "How to enforce" section).

Also apply the general checklist.

This file is generated by python3 scripts/rank.py fix from the guidelines. Don't edit it by hand.

  • DOTNET-1 (9) Load secrets through configuration providers: user secrets (the Secret Manager) in development, and Azure Key Vault or another vault in production, never appsettings.json or source code. (specific/dotnet) Automatable: GitHub secret scanning push protection.
  • DOTNET-2 (9) Go async all the way and never block on async code with .Result or .Wait(). (specific/dotnet) Automatable: CA1849, Microsoft.VisualStudio.Threading.Analyzers, VSTHRD002.
  • DOTNET-3 (8) Use the built-in DI container and follow its lifetime guidelines. (specific/dotnet) Automatable: Built-in DI scope validation.
  • DOTNET-4 (8) Add AddStandardResilienceHandler from Microsoft.Extensions.Http.Resilience to outgoing HttpClients. (specific/dotnet)
  • DOTNET-5 (7) When the domain has real business logic, structure the solution with Clean Architecture: an application core that defines interfaces, and infrastructure projects that implement them and that the core never references. (specific/dotnet) Automatable: ArchUnitNET.
  • DOTNET-6 (7) Register AddProblemDetails and UseExceptionHandler, so that errors are returned as ProblemDetails and exceptions are handled in one place. (specific/dotnet)
  • DOTNET-7 (7) Map separate liveness and readiness endpoints with MapHealthChecks, selecting the checks for each by tag. (specific/dotnet)
  • DOTNET-8 (7) Instrument with the OpenTelemetry .NET SDK, or with the .NET Aspire service defaults, which configure it for you. (specific/dotnet)
  • DOTNET-9 (7) Enable nullable reference types in all projects. (specific/dotnet) Automatable: Nullable warnings as errors.
  • DOTNET-10 (7) Test the HTTP pipeline with in-memory integration tests (WebApplicationFactory), and enforce layering with architecture tests. (specific/dotnet) Automatable: ArchUnitNET.
  • DOTNET-11 (6) Bind configuration to strongly typed classes with the options pattern. (specific/dotnet)
  • DOTNET-12 (6) Follow the EF Core performance guidance for queries and change tracking. (specific/dotnet)