Migrate to ASP.NET Core 3.0
Recipe ID
OpenRewrite.Recipes.CSharp.Migration.Dotnet.AspNetCore3.UpgradeToAspNetCore30ArtifactOpenRewrite.Recipes.CSharp.Migration.DotnetMigrate ASP.NET Core 2.2 projects to ASP.NET Core 3.0, including endpoint routing, Generic Host, and System.Text.Json changes. See https://learn.microsoft.com/en-us/aspnet/core/migration/22-to-30.
Composite recipecsharpaspnetcoremigrationProprietary
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.AspNetCore3.UpgradeToAspNetCore30If 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 ASP.NET Core 2.2
OpenRewrite.Recipes.CSharp.Migration.Dotnet.AspNetCore2.UpgradeToAspNetCore22 - Find UseMvc()/UseSignalR() calls
OpenRewrite.Recipes.CSharp.Migration.Dotnet.AspNetCore3.FindUseMvcOrUseSignalR - Find IHostingEnvironment usage
OpenRewrite.Recipes.CSharp.Migration.Dotnet.AspNetCore3.FindIHostingEnvironment - Find IApplicationLifetime usage
OpenRewrite.Recipes.CSharp.Migration.Dotnet.AspNetCore3.FindIApplicationLifetime - Find WebHostBuilder usage
OpenRewrite.Recipes.CSharp.Migration.Dotnet.AspNetCore3.FindWebHostBuilder - Find AddMvc() calls
OpenRewrite.Recipes.CSharp.Migration.Dotnet.AspNetCore3.FindAddMvc - Use
LoggerFactory.Create(...)instead ofnew LoggerFactory()OpenRewrite.Recipes.CSharp.Migration.Dotnet.AspNetCore3.UseLoggerFactoryCreate - Find Newtonsoft.Json usage in ASP.NET Core
OpenRewrite.Recipes.CSharp.Migration.Dotnet.AspNetCore3.FindNewtonsoftJsonUsage