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

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

Retargets a .NET Framework project to 4.8.1, applying the full 4.0 -> 4.8 chain and then bumping to 4.8.1. Updates <TargetFrameworkVersion> to v4.8.1, <TargetFramework> to net481, the app.config <supportedRuntime sku>, and the web.config targetFramework. .NET Framework 4.8.1 introduced no application-compatibility (retargeting) changes, so this step is purely the version bump. Compatibility caveat: 4.8.1 requires Windows 11 (21H2+) or Windows Server 2022+ at runtime and Visual Studio 2022 17.3+ to build, and is the only 4.x release with native Arm64 support. If any target machine runs Windows 10 or older Windows Server, stop at UpgradeToNetFramework48 instead. See https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/retargeting/4.8.x.

Composite recipeOpenRewritecsharpdotnetnet-frameworkmigrationnet481Moderne 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.

Definition

Recipes5

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