ASP.NET Core patterns for middleware order, DI lifetimes, HttpContext, CORS, CSRF, uploads, and 9 to 11 changes. Load before any edit in an ASP.NET Core app, however small, and for ASP.NET questions.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Aspnet Core Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ku5ic-aspnet-core-patterns)
---
name: aspnet-core-patterns
description: ASP.NET Core patterns for middleware order, DI lifetimes, HttpContext, CORS, CSRF, uploads, and 9 to 11 changes. Load before any edit in an ASP.NET Core app, however small, and for ASP.NET questions.
---
# ASP.NET Core patterns
Default assumption: ASP.NET Core 11 on .NET 11, per the ASP.NET Core release notes and the .NET support policy. 11 (STS) and 10 (LTS) are supported to 2028-11-14; 8 and 9 reached end of support on 2026-11-10.
A row applies when the app's `TargetFramework` is at least the row's version.
C# itself is csharp-patterns.
## Reference files
Loading this skill isn't enough. Before your next edit, read the file of every row that matches it. The rules live in those files, and this one only points at them.
| Before | Read |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Writing ASP.NET Core code, or raising the target framework | [reference/upgrades.md](reference/upgrades.md) |
| Writing, changing, or reviewing ASP.NET Core code | [reference/anti-patterns.md](reference/anti-patterns.md) |
| Writing an endpoint, antiforgery, or a background task, or resolving a service | [reference/practices.md](reference/practices.md) |
| Editing `Program.cs`: middleware, CORS, HTTPS, auth, error pages, OpenAPI, or services | [reference/program.md](reference/program.md) |
| Configuring the ASP.NET Core or .NET SDK analyzers | [reference/tooling.md](reference/tooling.md) |