migrate-dotnet8-to-dotnet9

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

Updated Sep 22, 2026
One-click install
npx skills add https://github.com/bytecakelake/Nurse-Scheduler --skill migrate-dotnet8-to-dotnet9-bytecakelake
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: migrate-dotnet8-to-dotnet9
Source: https://github.com/bytecakelake/Nurse-Scheduler/tree/main/.agents/plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9
Command: npx skills add https://github.com/bytecakelake/Nurse-Scheduler --skill migrate-dotnet8-to-dotnet9-bytecakelake

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 runtime, C# 13 compiler, ASP.NET Core, EF Core, and SDK tooling. Manually identifying which changes apply and how to fix them is error-prone and time-consuming. ## Core Features & Use Cases - Systematic Migration Workflow: Six-step process covering project assessment, TargetFramework update, build error resolution, behavioral change review, infrastructure updates, and verification. - Breaking Change References: Ten detailed reference documents organized by technology area (core libraries, C# compiler, ASP.NET Core, EF Core, cryptography, serialization/networking, WinForms/WPF, containers/interop, deployment/runtime, SDK/MSBuild) loaded on demand based on project type. - Concrete Fixes with Code Samples: Each breaking change includes impact level, before/after code examples, and mitigation guidance, covering SYSLIB0054-SYSLIB0057 obsoletions, params span overload resolution, BinaryFormatter removal, and EF Core 9 migration changes. - Use Case: You have an ASP.NET Core 8 API using EF Core and HttpClientFactory. This skill updates the TFM to net9.0, bumps package versions to 9.0.x, fixes the SocketsHttpHandler InvalidCastException, replaces non-deterministic HasData seed values, and updates 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 TargetFramework from net8.0 to net9.0 in each .csproj, bump Microsoft package references to 9.0.x versions, run dotnet restore, then fix build errors and review behavioral changes. The skill walks through assessment, build fixes, behavioral changes, infrastructure updates, and verification.

What breaking changes does .NET 9 introduce?▼

Key changes include params ReadOnlySpan overload resolution, BinaryFormatter always throwing, SYSLIB0054-SYSLIB0057 obsoletions, saturating float-to-integer conversions, HttpClientFactory defaulting to SocketsHttpHandler, and EF Core throwing on pending model changes during migrations.

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 due to security risks. Migrate to System.Text.Json, MessagePack, protobuf-net, or DataContractSerializer instead.

Can I use this skill to upgrade from .NET 7 or .NET Framework?▼

No, this skill only covers .NET 8 to .NET 9 migrations. Upgrading from .NET 7 or earlier requires addressing prior version breaking changes first, and .NET Framework migration is a separate, larger effort.

Why does EF Core 9 throw pending model changes errors?▼

EF Core 9's Migrate() and MigrateAsync() now throw if the model has pending changes compared to the last migration. A common cause is non-deterministic HasData seed values like DateTime.UtcNow or Guid.NewGuid(), which must be replaced with fixed constants.

What Visual Studio version is required for .NET 9?▼

Visual Studio 17.12 or later is required to target net9.0 with the .NET 9 SDK. VS 17.11 can only target net8.0 and earlier, producing error NETSDK1223 if you attempt to target .NET 9.