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.
Migrate to .NET 9
Recipe ID
OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net9.UpgradeToDotNet9Artifact
OpenRewrite.Recipes.CSharp.Migration.DotnetDefinition
Recipes42
42 recipes
- Migrate to .NET 8
- Change .NET target framework
- Upgrade NuGet package version
- Upgrade NuGet package version
- Upgrade NuGet package version
- Upgrade NuGet package version
- Upgrade NuGet package version
- Ensure csproj attestation
- Use Volatile.Read/Write (SYSLIB0054)
- Use X509CertificateLoader (SYSLIB0057)
- Use MapStaticAssets()
- Delete method argument
- Find LINQ ambiguities introduced by .NET 9
IAsyncEnumerableextensions - Find
AuthenticationManagerusage (SYSLIB0009) - Find
BinaryFormatterusage (removed in .NET 9) - Find
BinaryReader.ReadStringbehavior change - Find
EnumConverterconstructor validation change - Find
HttpListenerRequest.UserAgentnullable change - Find
InMemoryDirectoryInforootDir prepend change - Find
IncrementingPollingCounterasync callback change - Find
JsonSerializer.DeserializenullableJsonDocumentchange - Find
RuntimeHelpers.GetSubArrayreturn type change - Find
SafeEvpPKeyHandle.DuplicateHandleup-ref change - Find
ServicePointManagerusage (SYSLIB0014) - Find obsolete
X509Certificate2/X509Certificateconstructors (SYSLIB0057) - Find
ZipArchive.CreateEntrywithCompressionLevel(bit flag change) - Find
ZipArchiveEntryname/comment UTF-8 encoding change - Find
HttpClientHandlerusage (HttpClientFactory default change) - Find synchronous ExecuteUpdate/ExecuteDelete (EF Core 9)
- Find Swashbuckle usage (ASP.NET Core 9 built-in OpenAPI)
- Migrate Swashbuckle to built-in OpenAPI
- Find implicit authentication default scheme (ASP.NET Core 9)
- Use LINQ CountBy()
- Use Task.CompletedTask
- Remove ConfigureAwait(false)
- Use System.Threading.Lock for lock fields
- Use LINQ AggregateBy()
- Use LINQ Index()
- Use Frozen collections instead of Immutable
- Use \e escape sequence
- Find non-generic JsonStringEnumConverter
- Find IDistributedCache usage (HybridCache in .NET 9)
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.Net9.UpgradeToDotNet9