Migrate to .NET 5
Recipe ID
OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net5.UpgradeToDotNet5ArtifactOpenRewrite.Recipes.CSharp.Migration.DotnetMigrate C# projects from .NET Core 3.1 to .NET 5.0. Includes all .NET Core 3.0 and 3.1 migration steps. See https://learn.microsoft.com/en-us/dotnet/core/compatibility/5.0.
Composite recipecsharpdotnetmigrationProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net5.UpgradeToDotNet5If the recipe isn’t available locally, install it with:
mod config recipes nuget install OpenRewrite.Recipes.CSharp.Migration.DotnetDefinition
This recipe runs the following recipes in order.
- Migrate to .NET Core 3.1
OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net3_1.UpgradeToDotNet3_1 - Change .NET target framework
OpenRewrite.CSharp.Recipes.ChangeDotNetTargetFramework - Upgrade NuGet package version
OpenRewrite.CSharp.Recipes.UpgradeNuGetPackageVersion - Upgrade NuGet package version
OpenRewrite.CSharp.Recipes.UpgradeNuGetPackageVersion - Upgrade NuGet package version
OpenRewrite.CSharp.Recipes.UpgradeNuGetPackageVersion - Upgrade NuGet package version
OpenRewrite.CSharp.Recipes.UpgradeNuGetPackageVersion - Upgrade NuGet package version
OpenRewrite.CSharp.Recipes.UpgradeNuGetPackageVersion - Ensure csproj attestation
OpenRewrite.CSharp.Recipes.EnsureCsprojAttestation - Change type
OpenRewrite.Recipes.CSharp.Migration.Dotnet.ChangeType - Change type
OpenRewrite.Recipes.CSharp.Migration.Dotnet.ChangeType - Find Code Access Security usage (obsolete in .NET 5)
OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net5.FindCodeAccessSecurity - Find
PrincipalPermissionAttributeusage (SYSLIB0003)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net5.FindPrincipalPermissionAttribute - Find
Encoding.UTF7usage (SYSLIB0001)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net5.FindUtf7Encoding - Find
WinHttpHandlerusage (removed in .NET 5)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net5.FindWinHttpHandler - Find WinRT interop usage (removed in .NET 5)
OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net5.FindWinRTInterop