1(1)                                  .NET                                  (1)
2
3
4

Environment variables used by .NET SDK, .NET CLI, and .NET runtime

6       This article applies to: ✔️ .NET Core 2.1 SDK and later versions
7
8       Use the following environment variables to configure the .NET SDK, .NET
9       CLI, and .NET runtime.
10
11   DOTNET_ROOT, DOTNET_ROOT(x86)
12       Specifies the location of the .NET runtimes, if they are not  installed
13       in the default location.  The default location on Windows is C:\Program
14       Files\dotnet.   The  default   location   on   Linux   and   macOS   is
15       /usr/share/dotnet.  This environment variable is used only when running
16       apps via generated executables (apphosts).   DOTNET_ROOT(x86)  is  used
17       instead when running a 32-bit executable on a 64-bit OS.
18
19   NUGET_PACKAGES
20       The  global packages folder.  If not set, it defaults to ~/.nuget/pack‐
21       ages on Unix or %userprofile%\.nuget\packages on Windows.
22
23   DOTNET_SERVICING
24       Specifies the location of the servicing index to use by the shared host
25       when loading the runtime.
26
27   DOTNET_NOLOGO
28       Specifies  whether .NET welcome and telemetry messages are displayed on
29       first run.  Set to true to mute these messages (values true, 1, or  yes
30       accepted)  or  set to false to allow (values false, 0, or no accepted).
31       If not set, the default is false and the messages will be displayed  on
32       first   run.    This   flag  has  no  effect  on  telemetry  (see  DOT‐
33       NET_CLI_TELEMETRY_OPTOUT for opting out of sending telemetry).
34
35   DOTNET_CLI_TELEMETRY_OPTOUT
36       Specifies whether data about the .NET tools usage is collected and sent
37       to  Microsoft.  Set to true to opt-out of the telemetry feature (values
38       true, 1, or yes accepted).  Otherwise, set to false  to  opt  into  the
39       telemetry  features (values false, 0, or no accepted).  If not set, the
40       default is false and the telemetry feature is active.
41
42   DOTNET_MULTILEVEL_LOOKUP
43       Specifies whether .NET runtime, shared framework, or SDK  are  resolved
44       from the global location.  If not set, it defaults to 1 (logical true).
45       Set to 0 (logical false) to not resolve from the  global  location  and
46       have  isolated  .NET  installations.  For more information about multi-
47       level lookup, see Multi-level SharedFX Lookup  (https://github.com/dot
48       net/core-setup/blob/master/Documentation/design-docs/multilevel-shared‐
49       fx-lookup.md).
50
51   DOTNET_ROLL_FORWARD
52       Determines roll  forward  behavior.   For  more  information,  see  the
53       --roll-forward option earlier in this article.  Available starting with
54       .NET Core 3.x.
55
56   DOTNET_ROLL_FORWARD_TO_PRERELEASE
57       If set to 1 (enabled), enables rolling forward to a pre-release version
58       from a release version.  By default (0 - disabled), when a release ver‐
59       sion of .NET runtime is requested, roll-forward will only consider  in‐
60       stalled release versions.  Available starting with .NET Core 3.x.
61
62       For more information, see Roll forward.
63
64   DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX
65       Disables  minor  version  roll forward, if set to 0.  For more informa‐
66       tion, see Roll forward.
67
68       This setting is superseded in .NET  Core  3.0  by  DOTNET_ROLL_FORWARD.
69       The new settings should be used instead.
70
71   DOTNET_CLI_UI_LANGUAGE
72       Sets  the  language  of  the CLI UI using a locale value such as en-us.
73       The supported values are the same as for Visual Studio.  For  more  in‐
74       formation,  see  the  section on changing the installer language in the
75       Visual Studio installation documentation.  The  .NET  resource  manager
76       rules apply, so you don’t have to pick an exact match—you can also pick
77       descendants in the CultureInfo tree.  For example, if you set it to fr-
78       CA,  the CLI will find and use the fr translations.  If you set it to a
79       language that is not supported, the CLI falls back to English.
80
81   DOTNET_DISABLE_GUI_ERRORS
82       For GUI-enabled generated executables - disables  dialog  popup,  which
83       normally shows for certain classes of errors.  It only writes to stderr
84       and exits in those cases.
85
86   DOTNET_ADDITIONAL_DEPS
87       Equivalent to CLI option --additional-deps.
88
89   DOTNET_RUNTIME_ID
90       Overrides the detected RID.
91
92   DOTNET_SHARED_STORE
93       Location of the “shared store” which assembly resolution falls back  to
94       in some cases.
95
96   DOTNET_STARTUP_HOOKS
97       List of assemblies to load and execute startup hooks from.
98
99   DOTNET_BUNDLE_EXTRACT_BASE_DIR
100       Specifies  a  directory to which a single-file application is extracted
101       before it is executed.  Available starting with .NET Core 3.x.
102
103       For more information, see Single-file executables.
104
105   COREHOST_TRACE
106       Controls diagnostics tracing from the hosting components, such as  dot‐
107       net.exe, hostfxr, and hostpolicy.
108
109       • COREHOST_TRACE=[0/1] - default is 0 - tracing disabled.  If set to 1,
110         diagnostics tracing is enabled.
111
112       • COREHOST_TRACEFILE=<file path> - only has effect if  tracing  is  en‐
113         abled  via  COREHOST_TRACE=1.   When  set, the tracing information is
114         written to the specified file, otherwise the tracing  information  is
115         written to stderr.  Available starting with .NET Core 3.x.
116
117       • COREHOST_TRACE_VERBOSITY=[1/2/3/4]  -  default  is 4.  The setting is
118         used only when tracing is enabled  via  COREHOST_TRACE=1.   Available
119         starting with .NET Core 3.x.
120
121         • 4 - all tracing information is written
122
123         • 3 - only informational, warning and error messages are written
124
125         • 2 - only warning and error messages are written
126
127         • 1 - only error messages are written
128
129       The  typical  way  to  get detailed trace information about application
130       startup is to set COREHOST_TRACE=1 andCOREHOST_TRACEFILE=host_trace.txt
131       and then run the application.  A new file host_trace.txt will be creat‐
132       ed in the current directory with the detailed information.
133
134   DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE
135       Disables background download of advertising  manifests  for  workloads.
136       Default  is  false - not disabled.  If set to true, downloading is dis‐
137       abled.  For more information, see Advertising manifests.
138
139   DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_INTERVAL_HOURS
140       Specifies the minimum number of hours between background  downloads  of
141       advertising manifests for workloads.  Default is 24 - no more frequent‐
142       ly than once a day.  For more information, see Advertising manifests.
143
144   See also
145       • dotnet command
146
147       • Runtime      Configuration       Files       (https://github.com/dot
148         net/sdk/blob/main/documentation/specs/runtime-configuration-file.md)
149
150       • .NET runtime configuration settings
151
152
153
154                                                                           (1)
Impressum