Use AppContext.BaseDirectory on .NET Core
ProprietaryReplace 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. UseAppContextBaseDirectorymod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net3_1. UseAppContextBaseDirectoryInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.