To upgrade .NET 9 to .NET 10, here are instructions.
?
Step 1: Install the .NET 10 SDK
- Ensure you have the latest .NET 10 SDK installed. You can verify this by running dotnet --list-sdks in your terminal. If it's not installed, download and install it from the official .NET website.
- You may also need to update Visual Studio to a version that supports .NET 10, such as Visual Studio 2022 version 17.12 or newer, or use Visual Studio 2026.
Step 2: Update project files
- Open your project's .csproj file.
- Locate the <TargetFramework> property and change the value from net9.0 to net10.0.
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
- <TargetFramework>net9.0</TargetFramework>
+ <TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
</Project>
- If you have multiple target frameworks, update them all to the net10.0- prefix (e.g., <TargetFrameworks>net10.0-android;net10.0-ios</TargetFrameworks>).
Step 3: Update NuGet packages and build properties
- Update any NuGet packages in your project to their .NET 10 compatible versions, for example:
<ItemGroup>
- <PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="9.0.0" />
- <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0" />
- <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.0" />
- <PackageReference Include="System.Net.Http.Json" Version="9.0.0" />
+ <PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="10.0.0" />
+ <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.0" />
+ <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.0" />
+ <PackageReference Include="System.Net.Http.Json" Version="10.0.0" />
</ItemGroup>
- If targeting specific platforms like Mac Catalyst or iOS, adjust build properties such as $(SupportedOSPlatformVersion) to the correct .NET 10 version.
Step 4: Clean and rebuild
- Delete the bin and obj folders in your project to ensure a clean state.
- Rebuild your project.
P.S.: We recommend backing up your project files before upgrading.
Article ID: 2321, Created: December 2 at 9:43 PM, Modified: December 2 at 9:48 PM