Retarget to .NET Framework 4.8

Proprietary

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.

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

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Retarget .NET Framework 4.7.1 to 4.7.2
  2. Change .NET Framework version
  3. Change .NET target framework
  4. Change web.config target framework
  5. Ensure csproj attestation
  6. Find managed crypto classes (FIPS mode behavior change)