Environment variables used by .NET SDK, .NET CLI, and .NET runtime
This article applies to: ✔️ .NET Core 2.1 SDK and later versions
Use the following environment variables to configure the .NET SDK, .NET CLI, and .NET runtime.
Specifies the location of the .NET runtimes, if they are not installed in the default location. The default location on Windows is
C:\Program Files\dotnet. The default location on Linux and macOS is
/usr/share/dotnet. This environment variable is used only when running apps via generated executables (apphosts).
DOTNET_ROOT(x86) is used instead when running a 32-bit executable on a 64-bit OS.
The global packages folder. If not set, it defaults to
~/.nuget/packages on Unix or
%userprofile%\.nuget\packages on Windows.
Specifies the location of the servicing index to use by the shared host when loading the runtime.
Specifies whether .NET welcome and telemetry messages are displayed on first run. Set to
true to mute these messages (values
yes accepted) or set to
false to allow (values
no accepted). If not set, the default is
false and the messages will be displayed on first run. This flag has no effect on telemetry (see
Dotnet_cli_telemetry_optout for opting out of sending telemetry).
Specifies whether data about the .NET tools usage is collected and sent to Microsoft. Set to
true to opt-out of the telemetry feature (values
yes accepted). Otherwise, set to
false to opt into the telemetry features (values
no accepted). If not set, the default is
false and the telemetry feature is active.
Specifies whether .NET runtime, shared framework, or SDK are resolved from the global location. If not set, it defaults to 1 (logical
true). Set to 0 (logical
false) to not resolve from the global location and have isolated .NET installations. For more information about multi-level lookup, see Multi-level SharedFX Lookup (https://github.com/dotnet/core-setup/blob/master/Documentation/design-docs/multilevel-sharedfx-lookup.md).
Determines roll forward behavior. For more information, see the
--roll-forward option earlier in this article. Available starting with .NET Core 3.x.
If set to
1 (enabled), enables rolling forward to a pre-release version from a release version. By default (
0 - disabled), when a release version of .NET runtime is requested, roll-forward will only consider installed release versions. Available starting with .NET Core 3.x.
For more information, see Roll forward.
Disables minor version roll forward, if set to
0. For more information, see Roll forward.
This setting is superseded in .NET Core 3.0 by
Dotnet_roll_forward. The new settings should be used instead.
Sets the language of the CLI UI using a locale value such as
en-us. The supported values are the same as for Visual Studio. For more information, see the section on changing the installer language in the Visual Studio installation documentation. The .NET resource manager rules apply, so you don’t have to pick an exact match—you can also pick descendants in the
CultureInfo tree. For example, if you set it to
fr-CA, the CLI will find and use the
fr translations. If you set it to a language that is not supported, the CLI falls back to English.
For GUI-enabled generated executables - disables dialog popup, which normally shows for certain classes of errors. It only writes to
stderr and exits in those cases.
Equivalent to CLI option
Overrides the detected RID.
List of assemblies to load and execute startup hooks from.
Specifies a directory to which a single-file application is extracted before it is executed. Available starting with .NET Core 3.x.
For more information, see Single-file executables.
Controls diagnostics tracing from the hosting components, such as
COREHOST_TRACE=[0/1]- default is
0- tracing disabled. If set to
1, diagnostics tracing is enabled.
COREHOST_TRACEFILE=<file path>- only has effect if tracing is enabled via
COREHOST_TRACE=1. When set, the tracing information is written to the specified file, otherwise the tracing information is written to
stderr. Available starting with .NET Core 3.x.
COREHOST_TRACE_VERBOSITY=[1/2/3/4]- default is
4. The setting is used only when tracing is enabled via
COREHOST_TRACE=1. Available starting with .NET Core 3.x.
4- all tracing information is written
3- only informational, warning and error messages are written
2- only warning and error messages are written
1- only error messages are written
The typical way to get detailed trace information about application startup is to set
COREHOST_TRACEFILE=host_trace.txt and then run the application. A new file
host_trace.txt will be created in the current directory with the detailed information.
Disables background download of advertising manifests for workloads. Default is
false - not disabled. If set to
true, downloading is disabled. For more information, see Advertising manifests.
Specifies the minimum number of hours between background downloads of advertising manifests for workloads. Default is
24 - no more frequently than once a day. For more information, see Advertising manifests.
- dotnet command
- Runtime Configuration Files (https://github.com/dotnet/sdk/blob/main/documentation/specs/runtime-configuration-file.md)
- .NET runtime configuration settings