← All recipes
Moderne licensed

Migrate packages.config to <PackageReference> (net48)

Recipe IDOpenRewrite.Recipes.CSharp.Migration.Dotnet.NetFramework48.MigratePackagesConfigToPackageReferenceArtifactOpenRewrite.Recipes.CSharp.Migration.Dotnet

Moves NuGet package entries from packages.config into <PackageReference> items in the sibling .csproj, drops facade packages provided transitively by Microsoft.NETFramework.ReferenceAssemblies.Net48, adds that reference-assemblies package, and removes the now-empty packages.config. Scoped to .NET Framework 4.8 projects.

Single recipecsharpdotnetpackages-configcsprojnet48Proprietary

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.MigratePackagesConfigToPackageReference

If the recipe isn’t available locally, install it with:

mod config recipes nuget install OpenRewrite.Recipes.CSharp.Migration.Dotnet

Options

NameTypeDescription
ReferenceAssembliesVersionStringVersion of the Microsoft.NETFramework.ReferenceAssemblies.Net48 package to add. Defaults to 1.0.3.
e.g. 1.0.3