migrate-dotnet8-to-dotnet9

Migrate .NET 8 projects to .NET 9 and resolve all breaking changes.

1|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/D1ssolve/craft-agents --skill migrate-dotnet8-to-dotnet9-d1ssolve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-dotnet8-to-dotnet9
Source: https://github.com/D1ssolve/craft-agents/tree/main/skills/migrate-dotnet8-to-dotnet9
Command: npx skills add https://github.com/D1ssolve/craft-agents --skill migrate-dotnet8-to-dotnet9-d1ssolve

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Upgrading a project from .NET 8 to .NET 9 introduces dozens of breaking changes across the compiler, runtime, ASP.NET Core, EF Core, and cryptography APIs. This Skill provides a systematic, step-by-step workflow that updates the target framework, fixes build errors, addresses behavioral changes, and updates infrastructure so the migrated project builds cleanly and passes tests. ## Core Features & Use Cases - Guided six-step migration workflow: Assess the project, update the TargetFramework to net9.0, resolve source-incompatible changes, address behavioral changes, update Dockerfiles and CI/CD pipelines, then verify with clean builds and tests. - Technology-aware reference loading: Ten detailed reference documents cover C# 13 compiler changes, core libraries, ASP.NET Core 9, EF Core 9, cryptography, serialization/networking, WinForms/WPF, containers/interop, and deployment/runtime, loaded only when relevant to the project. - Concrete fixes for high-impact changes: Handles BinaryFormatter removal, params span overload resolution, SYSLIB0054-SYSLIB0057 obsoletions, EF Core pending-model-changes exceptions, HttpClientFactory SocketsHttpHandler changes, and saturating float-to-int conversions. - Use Case: You have an ASP.NET Core 8 Web API using EF Core and HttpClientFactory. This Skill walks you through retargeting to net9.0, updating package versions, fixing the new DI validation errors in development, replacing obsolete X509Certificate2 constructors, and updating your Dockerfile base images. ## Quick Start Migrate my .NET 8 solution at ./src/MyApp.sln to .NET 9 and fix all resulting build errors and breaking changes.

Frequently Asked Questions about migrate-dotnet8-to-dotnet9

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a .NET 8 project to .NET 9?

Update the TargetFramework in each .csproj from net8.0 to net9.0, bump Microsoft package references to 9.0.x, then run dotnet restore and a clean build. Work through the resulting errors using the breaking-change references for the compiler, core libraries, and any frameworks your project uses.

What are the breaking changes when upgrading from .NET 8 to .NET 9?

Key changes include BinaryFormatter always throwing, new params ReadOnlySpan overloads affecting overload resolution, SYSLIB0054-SYSLIB0057 obsoletions, EF Core throwing on pending model changes, HttpClientFactory defaulting to SocketsHttpHandler, and saturating float-to-int conversions. C# 13 also disallows InlineArray on record structs.

Why does BinaryFormatter throw NotSupportedException in .NET 9?

BinaryFormatter.Serialize and Deserialize now always throw NotSupportedException in .NET 9, and the EnableUnsafeBinaryFormatterSerialization switch was removed. Migrate to System.Text.Json, MessagePack, protobuf-net, or XmlSerializer depending on your data format and compatibility needs.

Does .NET 9 SDK work with Visual Studio 17.11?

No. Visual Studio 17.11 with the .NET 9 SDK can only target net8.0 and earlier. Targeting net9.0 requires Visual Studio 17.12 or later, otherwise you get error NETSDK1223.

Why does EF Core 9 throw pending model changes after upgrading?

EF Core 9's Migrate and MigrateAsync now throw if the model differs from the last migration snapshot. A common cause is non-deterministic values like DateTime.UtcNow or Guid.NewGuid() in HasData calls; replace them with fixed constants and add a new migration.

When should I not use this .NET 8 to .NET 9 migration skill?

Do not use it for .NET Framework migrations, upgrades from .NET 7 or earlier (address prior breaking changes first), greenfield .NET 9 projects, or projects already targeting net9.0 that build cleanly.