Modernize .NET Framework 4.8 project (SDK + PackageReference)
Recipe ID
OpenRewrite.Recipes.CSharp.Migration.Dotnet.NetFramework48.UpgradeToNetFramework48SdkArtifactOpenRewrite.Recipes.CSharp.Migration.DotnetMigrates a classic .NET Framework 4.8 csproj that uses packages.config to SDK-style with <PackageReference> entries. Combines MigratePackagesConfigToPackageReference and ConvertClassicCsprojToSdk so the resulting project builds with dotnet build on non-Windows machines via the Microsoft.NETFramework.ReferenceAssemblies.Net48 targeting pack.
Composite recipecsharpdotnetcsprojmigrationnet48Proprietary
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.NetFramework48.UpgradeToNetFramework48SdkIf 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
packages.configto<PackageReference>(net48)OpenRewrite.Recipes.CSharp.Migration.Dotnet.NetFramework48.MigratePackagesConfigToPackageReference - Convert classic csproj to SDK-style (net48)
OpenRewrite.Recipes.CSharp.Migration.Dotnet.NetFramework48.ConvertClassicCsprojToSdk