Workik.

.NET 8 to .NET 10 Migration: An Enterprise Upgrade Guide

Assess Your .NET 8 Solution Before Upgrading

Audit a .NET 8 solution before upgrading: inventory SDKs, target frameworks, NuGet packages, Dockerfiles and CI pipelines for .NET 10.

You cannot upgrade a system safely if you do not know its exact starting state. Larkfield Insurance runs three core applications: Larkfield.Claims.Api, Larkfield.Portal, and Larkfield.Billing.Worker. Before you touch project files or edit code, you must inventory every installed Software Development Kit (SDK), active Target Framework Moniker (TFM), outdated NuGet package, container image, and Continuous Integration and Continuous Deployment (CI/CD) pipeline.

Previous lesson: .NET 8 End of Support: Why and When to Move to .NET 10 | Next lesson: Upgrade .NET 8 Projects to .NET 10: SDK, TFM and Packages


Audit Installed SDKs, Runtimes, and global.json

Before checking your projects, inspect the machine environment where builds take place. The .NET CLI provides built-in discovery commands that require no extra tooling.

Run these three commands in your terminal to see which SDKs and runtimes exist on your development machine or build server:

bash
Copy

The output reveals whether you have the .NET 10 SDK installed alongside your existing .NET 8 tools. Multiple SDKs can live side by side without conflict.

Next, locate any global.json files in your repository. A global.json file pins the exact SDK version used by the CLI. If a repository root pins a .NET 8 SDK, the CLI keeps using it, and any project that targets net10.0 fails to build with error NETSDK1045 until you update that file.

bash
Copy

If Larkfield Insurance has a global.json file in its root directory, inspect its contents:

json
Copy

Common Mistake: Pinning a patch version in global.json and forgetting it exists. When developers install the .NET 10 SDK, their CLI continues to invoke the pinned .NET 8 SDK, creating confusion about why new features fail to compile.


Inventory Target Framework Monikers

A solution often contains dozens of projects. Some may target net8.0, while older shared libraries might still target netstandard2.0 or even net6.0. You must catalog every TFM in the repository.

Think of this audit like inspecting the architectural blueprints of a building before renovating: you need to verify which walls are load-bearing before you swing a hammer.

Run this shell command from the root of your repository to extract and count every target framework across all project and property files:

bash
Copy

A typical output for Larkfield Insurance looks like this:

text
Copy

Notice if your solution uses Directory.Build.props. If your team defines <TargetFramework> centrally inside Directory.Build.props, you can update all projects in one place. However, you must also verify whether individual .csproj files override that property locally.

Pro Tip: If an internal class library targets netstandard2.0, it can remain on netstandard2.0 while consuming projects move to .NET 10. You do not need to upgrade every library immediately if it contains no runtime-specific dependencies.


Scan Packages for Outdated, Vulnerable, and Deprecated Dependencies

Dependencies present the highest risk during any enterprise migration. A third-party library that lacks support for .NET 10 can block your upgrade path.

The .NET CLI contains native package auditing tools. Run these commands from your solution folder:

bash
Copy

The --outdated flag lists every package that has a newer version available on NuGet.

The --vulnerable --include-transitive flag inspects your entire dependency graph, including indirect dependencies pulled in by other libraries.

The --deprecated flag alerts you to packages that maintainers have abandoned or marked out of support.

Pro Tip: Check whether your solution uses Central Package Management by looking for a Directory.Packages.props file. If enabled, package versions are governed in a single XML file instead of scattered throughout individual .csproj files.

Pay close attention to internal corporate packages. If Larkfield.Claims.Api consumes a shared internal package named Larkfield.Common.Logging that strictly targets net8.0, that package must be recompiled or multi-targeted before your API can upgrade.


Audit Dockerfiles, CI/CD Pipelines, and Hosting Platforms

Code changes represent only half of an upgrade. Container configurations and automation scripts must match the new runtime target.

Search your repository for Docker base images:

bash
Copy

In the Larkfield solution, Larkfield.Claims.Api uses an ASP.NET Core base image:

dockerfile
Copy

Take note of two container facts for later: the base image tag 8.0 and any custom OS packages installed with package managers.

Next, scan your CI/CD workflow files. In GitHub Actions, search for the actions/setup-dotnet step across .github/workflows/:

yaml
Copy

If your build agent is pinned to 8.0.x, your pipeline will fail immediately when you push code that requires the .NET 10 SDK.

Finally, verify your hosting environments. If your services run on Azure App Service, AWS ECS, or Kubernetes, identify where the target runtime version is configured so you can plan the environment update alongside the deployment.


Optional Modernization Tooling: GitHub Copilot Modernization Agent

The older .NET Upgrade Assistant tool is officially deprecated. Microsoft now directs teams toward the GitHub Copilot modernization agent for assisted code assessment.

You can invoke this agent inside your development environment:

  • In Visual Studio: right-click your solution in Solution Explorer and select Modernize, or invoke @Modernize in Copilot Chat.
  • In Visual Studio Code: type @upgrade in the chat window.

The modernization agent performs several structured steps:

  • It analyzes your projects and dependencies for known migration issues.
  • It drafts a migration plan.
  • It writes plan files to a .github/upgrades/ folder in your repository.
  • It applies updates commit by commit on a separate Git branch.

Common Mistake: Treating automated modernization output as production-ready code without review. The GitHub Copilot modernization agent is a helper, not an automatic guarantee. You must still build, review every diff, run integration tests, and verify performance yourself.

Quick Challenge: Open your terminal in an existing .NET 8 repository and run dotnet list package --vulnerable --include-transitive. Note any transitive dependencies flagged with known vulnerabilities so you can prioritize them during package updates.


Try It Yourself

Perform a read-only assessment of your repository. Execute the following steps in order and save the results to a tracking document:

  1. Check your CLI runtime environment:
bash
Copy
  1. Search for any SDK pinning configurations:
bash
Copy
  1. Extract all target frameworks across projects:
bash
Copy
  1. Audit your NuGet packages for vulnerabilities and deprecations:
bash
Copy
  1. Find all Docker base images and workflow SDK definitions:
bash
Copy

Collect these findings into a migration inventory checklist. You will use this checklist to track your progress as you modify project files and build configurations.


In the next lesson, Upgrade .NET 8 Projects to .NET 10: SDK, TFM and Packages, you will update the project files, switch the TFM to net10.0, and configure package dependencies.

Was this lesson helpful?