Migrate to .NET 10
Recipe ID
OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.UpgradeToDotNet10ArtifactOpenRewrite.Recipes.CSharp.Migration.DotnetMigrate C# projects to .NET 10, applying necessary API changes. Includes all .NET 9 (and earlier) migration steps. See https://learn.microsoft.com/en-us/dotnet/core/compatibility/10.0.
Composite recipecsharpdotnetmigrationProprietary
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.Net10.UpgradeToDotNet10If 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 to .NET 9
OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net9.UpgradeToDotNet9 - Change .NET target framework
OpenRewrite.CSharp.Recipes.ChangeDotNetTargetFramework - Change .NET target framework
OpenRewrite.CSharp.Recipes.ChangeDotNetTargetFramework - Upgrade NuGet package version
OpenRewrite.CSharp.Recipes.UpgradeNuGetPackageVersion - Upgrade NuGet package version
OpenRewrite.CSharp.Recipes.UpgradeNuGetPackageVersion - Upgrade NuGet package version
OpenRewrite.CSharp.Recipes.UpgradeNuGetPackageVersion - Upgrade NuGet package version
OpenRewrite.CSharp.Recipes.UpgradeNuGetPackageVersion - Upgrade NuGet package version
OpenRewrite.CSharp.Recipes.UpgradeNuGetPackageVersion - Upgrade NuGet package version
OpenRewrite.CSharp.Recipes.UpgradeNuGetPackageVersion - Ensure csproj attestation
OpenRewrite.CSharp.Recipes.EnsureCsprojAttestation - Rename MLDsa/SlhDsa
SecretKeymembers toPrivateKeyOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.MlDsaSlhDsaSecretKeyToPrivateKey - Rename
Form.OnClosing/OnClosedtoOnFormClosing/OnFormClosed(WFDEV004)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FormOnClosingRename - Rename
orientparameter toorientationinHtmlElement.InsertAdjacentElementOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.InsertAdjacentElementOrientParameterRename - Rename
KnownNetworkstoKnownIPNetworks(ASPDEPR005)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.KnownNetworksRename - Remove obsolete
AddRazorRuntimeCompilationcalls (ASPDEPR003)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.RazorRuntimeCompilationObsolete - Remove deprecated
WithOpenApicalls (ASPDEPR002)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.WithOpenApiDeprecated - Find obsolete
IActionContextAccessor/ActionContextAccessor(ASPDEPR006)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindActionContextAccessorObsolete - Find
ActivitySamplingResult.PropagationDatabehavior changeOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindActivitySampling - Find
BackgroundService.ExecuteAsyncbehavior changeOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindBackgroundServiceExecuteAsync - Find
BufferedStream.WriteByteimplicit flush behavior changeOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindBufferedStreamWriteByte - Find
DistributedContextPropagatordefault propagator changeOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindDistributedContextPropagator - Find
DllImportSearchPath.AssemblyDirectorybehavior changeOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindDllImportSearchPath - Find
DriveInfo.DriveFormatbehavior changeOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindDriveInfoDriveFormat - Find
GnuTarEntry/PaxTarEntrydefault timestamp changeOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindGnuTarPaxTarEntry - Find obsolete
IPNetwork/KnownNetworks(ASPDEPR005)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindIpNetworkObsolete - Find
KeyedService.AnyKeybehavior changeOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindKeyedServiceAnyKey - Find
Type.MakeGenericSignatureTypevalidation changeOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindMakeGenericSignatureType - Find obsolete
Queryable.MaxBy/MinBywithIComparer<TSource>(SYSLIB0061)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindQueryableMaxByMinByObsolete - Find obsolete
AddRazorRuntimeCompilationcalls (ASPDEPR003)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindRazorRuntimeCompilationObsolete - Find obsolete
Rfc2898DeriveBytesconstructors (SYSLIB0060)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindRfc2898DeriveBytesObsolete - Find obsolete
SslStreamcipher properties (SYSLIB0058)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindSslStreamObsoleteProperties - Find
catch (OutOfMemoryException)that may needExternalExceptionOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindSystemDrawingExceptionChange - Find obsolete
SystemEvents.EventsThreadShutdown(SYSLIB0059)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindSystemEventsThreadShutdownObsolete - Find obsolete
WebHostBuilder/IWebHost/WebHostusage (ASPDEPR004/ASPDEPR008)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindWebHostBuilderObsolete - Find obsolete Windows Forms APIs (WFDEV004/005/006)
OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindWinFormsObsoleteApis - Find deprecated
WithOpenApicalls (ASPDEPR002)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindWithOpenApiDeprecated - Find
X500DistinguishedNamestring constructor stricter validationOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindX500DistinguishedNameValidation - Find obsolete
XsltSettings.EnableScript(SYSLIB0062)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindXsltSettingsEnableScriptObsolete - Find obsolete SSL authentication enum types
OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindSslAuthEnumTypes - Find obsolete
Form.OnClosing/OnClosedusage (WFDEV004)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindFormOnClosingObsolete - Find obsolete
Clipboard.GetDatacalls (WFDEV005)OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindClipboardGetData