Skip to main content
Moderne OnlyThis recipe is proprietary to Moderne and runs on the Moderne platform or CLI — it isn’t part of the open-source catalog. Available with a Moderne subscription.Contact Sales

Retarget to .NET Framework 4.8

Recipe IDOpenRewrite.Recipes.CSharp.Migration.Dotnet.NetFramework.UpgradeToNetFramework48
ArtifactOpenRewrite.Recipes.CSharp.Migration.Dotnet

Retargets a .NET Framework project to 4.8, the recommended modern target. Applies every intermediate minor-version step in order (4.0 -> 4.5 -> 4.5.1 -> 4.5.2 -> 4.6 -> 4.6.1 -> 4.6.2 -> 4.7 -> 4.7.1 -> 4.7.2 -> 4.8), updating <TargetFrameworkVersion> and <TargetFramework> in legacy and SDK-style csproj files, the <supportedRuntime sku> in app.config, and the targetFramework attribute in web.config at each step, and flagging affected source for review. Notable retargeting changes when reaching 4.8: managed crypto classes no longer throw in FIPS mode (Switch.System.Security.Cryptography.UseLegacyFipsThrow=true to revert); a third wave of accessibility improvements applies (keep legacy with all of Switch.UseLegacyAccessibilityFeatures, .2, and .3); HwndHost resizes correctly under per-monitor DPI; several WF/WPF checksum/hash defaults move to SHA-256. See https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/retargeting/4.8.x.

Composite recipeOpenRewritecsharpdotnetnet-frameworkmigrationnet48Moderne Proprietary License
Try in PlatformTry this recipe in the Moderne platform. Not a user yet? You’ll get a no-setup demo environment, with nothing to install or configure.

Usage

Run this recipe

In order to run C# recipes, you will need to use the Moderne CLI.

Once the CLI is installed, you can install this C# recipe package by running the following command:

Install the recipe package
mod config recipes nuget install OpenRewrite.Recipes.CSharp.Migration.Dotnet

Then, you can run the recipe via:

Run the recipe
mod run . --recipe OpenRewrite.Recipes.CSharp.Migration.Dotnet.NetFramework.UpgradeToNetFramework48