|
| 1 | +--- |
| 2 | +title: Migrate from ASP.NET Core in .NET 9 to ASP.NET Core in .NET 10 |
| 3 | +author: wadepickett |
| 4 | +description: Learn how to migrate an ASP.NET Core in .NET 9 to ASP.NET Core in .NET 10. |
| 5 | +ms.author: wpickett |
| 6 | +ms.date: 8/14/2025 |
| 7 | +uid: migration/90-to-100 |
| 8 | +--- |
| 9 | +# Migrate from ASP.NET Core in .NET 9 to ASP.NET Core in .NET 10 |
| 10 | + |
| 11 | +<!-- New content should be added to the includes files in the '90-to-100' folder. This will help prevent merge conflicts in this file. --> |
| 12 | + |
| 13 | +This article explains how to update an ASP.NET Core in .NET 9 to ASP.NET Core in .NET 10. |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +<!-- NOTE: The prereqs INCLUDES files have are in a poor state these days. I've opened |
| 18 | + https://github.com/dotnet/AspNetCore.Docs/issues/35937 to work on them. |
| 19 | + For now, we'll use what's available. |
| 20 | + |
| 21 | + I'll remove this remark before merging the passkeys PR. --> |
| 22 | + |
| 23 | +# [Visual Studio](#tab/visual-studio) |
| 24 | + |
| 25 | +[!INCLUDE[](~/includes/net-prereqs-vs-10-latest.md)] |
| 26 | + |
| 27 | +# [Visual Studio Code](#tab/visual-studio-code) |
| 28 | + |
| 29 | +[!INCLUDE[](~/includes/net-prereqs-vsc-10.0.md)] |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## Update the .NET SDK version in `global.json` |
| 34 | + |
| 35 | +If you rely on a [`global.json`](/dotnet/core/tools/global-json) file to target a specific .NET SDK version, update the `version` property to the .NET 10 SDK version that's installed. For example: |
| 36 | + |
| 37 | +```diff |
| 38 | +{ |
| 39 | + "sdk": { |
| 40 | +- "version": "9.0.304" |
| 41 | ++ "version": "10.0.100" |
| 42 | + } |
| 43 | +} |
| 44 | +``` |
| 45 | + |
| 46 | +## Update the target framework |
| 47 | + |
| 48 | +Update the project file's [Target Framework Moniker (TFM)](/dotnet/standard/frameworks) to `net10.0`: |
| 49 | + |
| 50 | +```diff |
| 51 | +<Project Sdk="Microsoft.NET.Sdk.Web"> |
| 52 | + |
| 53 | + <PropertyGroup> |
| 54 | +- <TargetFramework>net9.0</TargetFramework> |
| 55 | ++ <TargetFramework>net10.0</TargetFramework> |
| 56 | + </PropertyGroup> |
| 57 | + |
| 58 | +</Project> |
| 59 | +``` |
| 60 | + |
| 61 | +## Update package references |
| 62 | + |
| 63 | +In the project file, update each [`Microsoft.AspNetCore.*`](https://www.nuget.org/packages?q=Microsoft.AspNetCore.*), [`Microsoft.EntityFrameworkCore.*`](https://www.nuget.org/packages?q=Microsoft.EntityFrameworkCore.*), [`Microsoft.Extensions.*`](https://www.nuget.org/packages?q=Microsoft.Extensions.*), and [`System.Net.Http.Json`](https://www.nuget.org/packages/System.Net.Http.Json) package reference's `Version` attribute to 10.0.0 or later. For example: |
| 64 | + |
| 65 | +```diff |
| 66 | +<ItemGroup> |
| 67 | +- <PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="9.0.0" /> |
| 68 | +- <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0" /> |
| 69 | +- <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.0" /> |
| 70 | +- <PackageReference Include="System.Net.Http.Json" Version="9.0.0" /> |
| 71 | ++ <PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="10.0.0" /> |
| 72 | ++ <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.0" /> |
| 73 | ++ <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.0" /> |
| 74 | ++ <PackageReference Include="System.Net.Http.Json" Version="10.0.0" /> |
| 75 | +</ItemGroup> |
| 76 | +``` |
| 77 | + |
| 78 | +## Blazor |
| 79 | + |
| 80 | +[!INCLUDE[](~/migration/90-to-100/includes/blazor.md)] |
| 81 | + |
| 82 | +## Breaking changes |
| 83 | + |
| 84 | +Use the articles in [Breaking changes in .NET](/dotnet/core/compatibility/breaking-changes) to find breaking changes that might apply when upgrading an app to a newer version of .NET. |
0 commit comments