How to Upgrade ASP.NET Core 10 to .NET 11: Migration and Rollback
Upgrade an ASP.NET Core 10 application by pinning the .NET 11 SDK on a migration branch, retargeting to net11.0, aligning dependencies, and proving that the published artifact still satisfies its public contracts. Keep the existing .NET 10 deployment artifact available until a production canary passes.
What changes during the migration?
| Layer | Before | Verify after |
|---|---|---|
| SDK selection | .NET 10 global.json | Build and CI select a supported .NET 11 SDK |
| App target | net10.0 | net11.0 artifact builds and starts |
| Packages | Existing compatible versions | ASP.NET and EF provider major versions align where upgraded |
| Contract | Existing JSON, auth, status codes and OpenAPI | Baseline contract tests still pass |
| Hosting | .NET 10 runtime or self-contained build | Actual host, image and deployment slots match the artifact |
Start with Microsoft’s migration guide and ASP.NET Core 11 breaking changes. A supported .NET 10 LTS deployment gives teams time to evaluate the STS upgrade.
Establish a baseline first
Record the current artifact ID, SDK version and production host configuration. Save representative response bodies and status codes from the old deployment, including unauthorized requests and invalid input. If you publish OpenAPI, capture that artifact too. In .NET 11 generated OpenAPI defaults to 3.2. Older client generators may need an explicit 3.1 setting while you validate them.
Keep EF Core and its database provider compatible. Check the actual database compatibility level, which can differ from the server version. If a migration changes persistent data, plan backward compatibility before rolling back an application build. An older binary cannot necessarily read data written under a new schema.
Run a small contract check
This deliberately small app demonstrates preserving a JSON response and a validation status across the target-framework change. It does not model a full production dependency graph.
Use the supplied net11.0 project. To produce a before baseline, start from an equivalent project targeting net10.0 on an installed .NET 10 SDK, without the .NET 11 SDK pin. Capture the same requests in each environment.
Request /health and /orders/42. Check 200 responses and compare JSON values. Request /orders/0 and verify 400. Add your real authentication, model binding, integration tests, and supported API clients before promoting a migration.
Deploy the same artifact you tested
For a framework-dependent Docker deployment, align the build and ASP.NET runtime images and verify architecture and base OS variants. On IIS, verify the appropriate Hosting Bundle and app pool setup. In Azure App Service, verify runtime availability on the actual OS and deployment slot. If you deploy self-contained, check the target RID and platform prerequisites. Review the IIS deployment guide.
Canary with normal traffic patterns and watch error rates, latency, resource use and dependency failures. Retain the previous deployment artifact and record the rollback trigger. Use expand-and-contract schema changes where old and new versions must coexist.
FAQ
Is a clean build sufficient? Run the published artifact with production-like configuration and test the public contracts.
Why does the app work locally but fail on IIS? Compare the deployment mode, installed runtime, Hosting Bundle, architecture and app configuration on the server.
Should I update all packages in one pull request? Group dependencies by compatibility requirement. Smaller migration steps can make a change in behavior easier to attribute.
Comments
Post a Comment