Replace PlatformServices with AppContext
Recipe ID
OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net3_0.UsePlatformAbstractionsReplacementArtifactOpenRewrite.Recipes.CSharp.Migration.DotnetReplaces Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationBasePath with System.AppContext.BaseDirectory. The PlatformAbstractions package was removed in .NET Core 3.0. Also removes the obsolete using directive.
Single 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.Net3_0.UsePlatformAbstractionsReplacementIf the recipe isn’t available locally, install it with:
mod config recipes nuget install OpenRewrite.Recipes.CSharp.Migration.Dotnet