.NET 5.0 will reach end of life on May 08, 2022. After that time, .NET 5.0 patch updates will no longer be provided.
So don’t wait until then to upgrade your .NET 5 application to .NET 6. Upgrading is easy:
- Update your global.json file (if applicable) to the .NET 6 SDK:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sdk": { | |
"version": "6.0.100" | |
} | |
} |
- Update the target framework moniker in your csproj file:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk.Web"> | |
<PropertyGroup> | |
<TargetFramework>net6.0</TargetFramework> | |
</PropertyGroup> | |
</Project> |
- Update the ASP.NET Core package references to 6.0.0 or later:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ItemGroup> | |
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" /> | |
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" /> | |
</ItemGroup> |
Remark: If you want you can start using new features in .NET 6 like the minimal hosting model but this is not necessary.
More information: https://docs.microsoft.com/en-us/aspnet/core/migration/50-to-60?WT.mc_id=DOP-MVP-5001942