<PackageReference Include="System.AppContext" Version="4.0.1-beta-23409" />

AppContext

public static class AppContext
Provides members for setting and retrieving data about an application's context.
public static string BaseDirectory { get; }

Gets the pathname of the base directory that the assembly resolver uses to probe for assemblies.

public static void SetSwitch(string switchName, bool isEnabled)

Sets the value of a switch.

public static bool TryGetSwitch(string switchName, out bool isEnabled)

Trues to get the value of a switch.