migrate-dotnet8-to-dotnet9

Migrates .NET 8 projects to .NET 9 and resolves all breaking changes.

Updated Jul 12, 2026
One-click install
npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill migrate-dotnet8-to-dotnet9-patrick-rex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-dotnet8-to-dotnet9
Source: https://github.com/Patrick-Rex/DotNetTechSamples/tree/main/.agents/plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9
Command: npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill migrate-dotnet8-to-dotnet9-patrick-rex

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 SDK tooling. Manually tracking down every build error, new obsoletion warning, and silent behavioral change is error-prone and time-consuming. ## Core Features & Use Cases - Systematic Migration Workflow: Guides a six-step process from project assessment and TargetFramework update through build error resolution, behavioral change review, infrastructure updates, and final verification. - Breaking Change Reference Library: Ships ten detailed reference documents covering C# 13 compiler changes, core libraries, ASP.NET Core 9, EF Core 9, cryptography, serialization, networking, WinForms/WPF, containers, and deployment, loaded on demand based on project type. - Concrete Fix Guidance: Provides before/after code fixes for high-impact issues such as BinaryFormatter removal, params span overload resolution, SYSLIB0054-SYSLIB0057 obsoletions, EF Core pending-model-changes exceptions, and HttpClientFactory handler changes. - Use Case: A team upgrades their ASP.NET Core + EF Core service to net9.0 and hits build errors plus a runtime exception from Migrate(). The skill identifies the applicable breaking changes, supplies exact fixes, and updates the Dockerfile and CI pipeline for .NET 9. ## Quick Start Migrate my .NET 8 solution 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 versions, then run dotnet restore and a clean build. Resolve resulting errors using the breaking change references, address behavioral changes, and update Dockerfiles and CI pipelines.

What breaking changes does .NET 9 introduce?

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

Why does BinaryFormatter throw NotSupportedException in .NET 9?

BinaryFormatter.Serialize and Deserialize now always throw NotSupportedException because the format is inherently unsafe and enables remote code execution. Migrate to System.Text.Json, MessagePack, protobuf-net, or DataContractSerializer instead.

Why does EF Core Migrate() throw after upgrading to .NET 9?

EF Core 9 throws when the model has pending changes or when Migrate() runs inside a user transaction. Common causes are DateTime.Now or Guid.NewGuid() in HasData calls; replace them with fixed constants and remove external transaction wrappers.

Can I use this migration approach for .NET Framework or .NET 7 projects?

No. This workflow only covers .NET 8 to .NET 9 upgrades. .NET Framework migrations are a separate larger effort, and projects on .NET 7 or earlier should first address the breaking changes from the intermediate versions.

What Visual Studio version is required to target net9.0?

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 net9.0 is attempted.