DOTNET-ENVIRONMENT-VARIABLES(1)

πŸ“¦ version 6.0.136, in ubuntu jammy

🌈 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. ✨

Specifies whether .NET welcome and telemetry messages are displayed on first run.

  • set to true to mute these messages (values true, 1, or yes accepted) 🀫
  • set to false to allow them (values false, 0, or no accepted) πŸ‘€

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 true to opt-out of the telemetry feature (values true, 1, or yes accepted) 🚫
  • otherwise set to false to opt into the telemetry features (values false, 0, or no accepted) βœ…

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 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_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


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