Use AppContext.BaseDirectory on .NET Core

Proprietary

Replace resolved AppDomain.CurrentDomain.BaseDirectory with global::System.AppContext.BaseDirectory when every effective target is .NET Core3.1 or later, whose implementation directly delegates to AppContext. Retain expression/name identity and string attribution. Keep Framework/Standard targets, unknown imports/owners, target shadows, conditional snapshots, comments, deferred contexts and files without CSharp2+ syntax evidence unchanged.

OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net3_1.UseAppContextBaseDirectory
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net3_1.UseAppContextBaseDirectory

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