roninforge/roninforge-aspnet/aspnet-migrate-to-9
Claude Code and agent skill by roninforge/roninforge-aspnet
- community
Checking that the SKILL.md file is still in the repository.
Migrate an older ASP.NET Core project to .NET 9: Startup.cs to top-level Program.cs, sync to async, new HttpClient to IHttpClientFactory, Newtonsoft.Json to System.Text.Json, Swashbuckle to Microsoft.AspNetCore.OpenApi, hand-rolled JWT to AddJwtBearer.
Install
npx vskill@latest install roninforge/roninforge-aspnet/aspnet-migrate-to-9SKILL.md
The same SKILL.md was published earlier as roninforge/roninforge-aspnet/aspnet-migrate-to-9.
Migrate ASP.NET Core to .NET 9
When to Use
When inheriting a .NET 6/7/8 project, or modernising AI-generated ASP.NET Core code that uses pre-template patterns.
Instructions
Apply in order. Build after each step.
Step 1: Bump TFM
*.csproj:
Update package references to versions compatible with .NET 9 (Microsoft.AspNetCore.* 9.x, Microsoft.EntityFrameworkCore.* 9.x, etc).
Step 2: Startup.cs to top-level Program.cs
Delete Startup.cs. Rewrite Program.cs:
Step 3: Newtonsoft.Json to System.Text.Json
Remove the package:
Find every JsonConvert.SerializeObject / JsonConvert.DeserializeObject and replace:
For controllers, remove .AddNewtonsoftJson() from the chain.
Watch for behavioral differences:
- Newtonsoft is case-insensitive by default; STJ is case-sensitive. Set
PropertyNameCaseInsensitive = trueor use source-gen. - Newtonsoft accepts trailing commas in JSON; STJ requires
AllowTrailingCommas = true. - Polymorphic serialization differs - STJ uses
[JsonDerivedType]; Newtonsoft uses[JsonSubtype].
Step 4: new HttpClient() to IHttpClientFactory
Find every new HttpClient(...):
Step 5: Sync to async
Search for .Result and .Wait():
Each match is a candidate for await conversion.
Step 6: Swashbuckle to AddOpenApi
If you want a UI, add Scalar or Swashbuckle's UI package back:
Step 7: Tracking queries to AsNoTracking + projection
For every read path:
Step 8: Hand-rolled auth to AddJwtBearer / MapIdentityApi
For first-party SPA/mobile clients consider MapIdentityApi<TUser>() instead.
Step 9: Verify
Visit /openapi/v1.json to confirm OpenAPI generates correctly. Visit /healthz if you wired health checks.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/aspnet-migrate-to-9/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/roninforge/roninforge-aspnet/aspnet-migrate-to-9)