DOTNET-ENVIRONMENT-VARIABLES(1)
π Environment variables used by .NET SDK, .NET CLI, and .NET runtime π
ok bestie, welcome to the .NET manual, section (1) π this is the page where we spill every single env var you can use to configure the .NET SDK, the .NET CLI, and the .NET runtime. no cap, it's a lot of them, but we're getting through all of it together. π«Ά
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. π
π DOTNET_ROOT, DOTNET_ROOT(x86)
Specifies the location of the .NET runtimes, if they are not installed in the default location. π
- default location on Windows:
C:\Program Files\dotnet - default location on Linux and macOS:
/usr/share/dotnet
This environment variable is used only when running apps via generated executables (apphosts). And DOTNET_ROOT(x86) is used instead when you're running a 32-bit executable on a 64-bit OS. π¦
π¦ NUGET_PACKAGES
The global packages folder. If you don't set it, it defaults to ~/.nuget/packages on Unix or %userprofile%\.nuget\packages on Windows. periodt. π
π οΈ DOTNET_SERVICING
Specifies the location of the servicing index to use by the shared host when loading the runtime. iykyk. β¨
π DOTNET_NOLOGO
Specifies whether .NET welcome and telemetry messages are displayed on first run.
- set to
trueto mute these messages (valuestrue,1, oryesaccepted) π€« - set to
falseto allow them (valuesfalse,0, ornoaccepted) π
If it's not set, the default is false and the messages will be displayed on first run. And heads up bestie: this flag has no effect on telemetry (see DOTNET_CLI_TELEMETRY_OPTOUT for opting out of sending telemetry). π
π‘ DOTNET_CLI_TELEMETRY_OPTOUT
Specifies whether data about the .NET tools usage is collected and sent to Microsoft.
- set to
trueto opt-out of the telemetry feature (valuestrue,1, oryesaccepted) π« - otherwise set to
falseto opt into the telemetry features (valuesfalse,0, ornoaccepted) β
If it's not set, the default is false and the telemetry feature is active. π
π DOTNET_MULTILEVEL_LOOKUP
Specifies whether .NET runtime, shared framework, or SDK are resolved from the global location.
If it's not set, it defaults to 1 (logical true). Set it 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).
β© DOTNET_ROLL_FORWARD
Determines roll forward behavior. For more information, see the --roll-forward option earlier in this article. Available starting with .NET Core 3.x. β¨
π± DOTNET_ROLL_FORWARD_TO_PRERELEASE
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.
π§ DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX
Disables minor version roll forward, if set to 0. For more information, see Roll forward.
β οΈ bestie, this setting is superseded in .NET Core 3.0 by DOTNET_ROLL_FORWARD. The new settings should be used instead. don't be out here using the old one π
π£οΈ DOTNET_CLI_UI_LANGUAGE
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. And if you set it to a language that is not supported, the CLI falls back to English. π¬π§
πΌοΈ DOTNET_DISABLE_GUI_ERRORS
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. lowkey iconic of it. π
β DOTNET_ADDITIONAL_DEPS
Equivalent to CLI option --additional-deps. slay. β¨
π DOTNET_RUNTIME_ID
Overrides the detected RID.
π¬ DOTNET_SHARED_STORE
Location of the "shared store" which assembly resolution falls back to in some cases. ποΈ
π DOTNET_STARTUP_HOOKS
List of assemblies to load and execute startup hooks from.
π DOTNET_BUNDLE_EXTRACT_BASE_DIR
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.
π΅οΈ COREHOST_TRACE
Controls diagnostics tracing from the hosting components, such as dotnet.exe, hostfxr, and hostpolicy. π
COREHOST_TRACE=[0/1]- default is0- tracing disabled. If set to1, diagnostics tracing is enabled.COREHOST_TRACEFILE=<file path>- only has effect if tracing is enabled viaCOREHOST_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 is4. The setting is used only when tracing is enabled viaCOREHOST_TRACE=1. Available starting with .NET Core 3.x.4- all tracing information is written3- only informational, warning and error messages are written2- only warning and error messages are written1- only error messages are written
The typical way to get detailed trace information about application startup is to set COREHOST_TRACE=1 and 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. π
ποΈ DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE
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. π
β° DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_INTERVAL_HOURS
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. β¨
π See also
- dotnet command
- Runtime Configuration Files (https://github.com/dotnet/sdk/blob/main/documentation/specs/runtime-configuration-file.md)
- .NET runtime configuration settings
and that's the whole page, bestie π straight from the .NET manual, section (1) β go forth and configure responsibly, you absolute main character. π«Άβ¨π
π¦ where this page comes from
- ubuntu jammy: dotnet-host 6.0.135-0ubuntu1~22.04.1 Β· MIT
- ubuntu jammy: dotnet-host 6.0.136-0ubuntu1~22.04.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms