Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions docs/core/dependency-loading/default-probing.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ Each property is available by calling the <xref:System.AppContext.GetData(System

The .NET Core runtime host will output useful trace messages when certain environment variables are enabled:

|Environment Variable |Description |
|----------------------------|---------|
|`COREHOST_TRACE=1` |Enables tracing.|
|`COREHOST_TRACEFILE=<path>` |Traces to a file path instead of the default `stderr`.|
|`COREHOST_TRACE_VERBOSITY` |Sets the verbosity from 1 (lowest) to 4 (highest).|
|Environment Variable |Description |
|-------------------------------|---------|
|`DOTNET_HOST_TRACE=1` |Enables tracing. (.NET 10+)|
|`DOTNET_HOST_TRACEFILE=<path>` |Traces to a file path instead of the default `stderr`. (.NET 10+)|
|`DOTNET_HOST_TRACE_VERBOSITY` |Sets the verbosity from 1 (lowest) to 4 (highest). (.NET 10+)|
|`COREHOST_TRACE=1` |Enables tracing.|
|`COREHOST_TRACEFILE=<path>` |Traces to a file path instead of the default `stderr`.|
|`COREHOST_TRACE_VERBOSITY` |Sets the verbosity from 1 (lowest) to 4 (highest).|

## Managed assembly default probing

Expand Down
23 changes: 19 additions & 4 deletions docs/core/tools/dotnet-environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,19 +395,34 @@ Specifies the minimum number of hours between background downloads of advertisin

Specifies whether .NET SDK local tools search for tool manifest files in the root folder on Windows. The default is `false`.

### `COREHOST_TRACE`
### `DOTNET_HOST_TRACE`

**This variable applies to .NET 10 and later versions.** For older versions, replace the `DOTNET_HOST_` prefix with `COREHOST_`. See [`COREHOST_TRACE`](#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>` - has an effect only if tracing is enabled by setting `COREHOST_TRACE=1`. When set, the tracing information is written to the specified file; otherwise, the trace information is written to `stderr`.
- `COREHOST_TRACE_VERBOSITY=[1/2/3/4]` - default is `4`. The setting is used only when tracing is enabled via `COREHOST_TRACE=1`.
- `DOTNET_HOST_TRACE=[0/1]` - default is `0` - tracing disabled. If set to `1`, diagnostics tracing is enabled.
- `DOTNET_HOST_TRACEFILE=<file path>` - has an effect only if tracing is enabled by setting `DOTNET_HOST_TRACE=1`. When set, the tracing information is written to the specified file; otherwise, the trace information is written to `stderr`.
- `DOTNET_HOST_TRACE_VERBOSITY=[1/2/3/4]` - default is `4`. The setting is used only when tracing is enabled via `DOTNET_HOST_TRACE=1`.

- `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 `DOTNET_HOST_TRACE=1` and `DOTNET_HOST_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.

### `COREHOST_TRACE`

Controls diagnostics tracing from the hosting components, such as `dotnet.exe`, `hostfxr`, and `hostpolicy`.

> [!NOTE]
> Starting with .NET 10, use the [`DOTNET_HOST_TRACE`](#dotnet_host_trace) environment variables instead. The `COREHOST_TRACE` variables work the same as `DOTNET_HOST_TRACE` variables.

- `COREHOST_TRACE=[0/1]` - default is `0` - tracing disabled. If set to `1`, diagnostics tracing is enabled.
- `COREHOST_TRACEFILE=<file path>` - has an effect only if tracing is enabled by setting `COREHOST_TRACE=1`. When set, the tracing information is written to the specified file; otherwise, the trace information is written to `stderr`.
- `COREHOST_TRACE_VERBOSITY=[1/2/3/4]` - default is `4`. The setting is used only when tracing is enabled via `COREHOST_TRACE=1`. For verbosity level meanings, see [`DOTNET_HOST_TRACE_VERBOSITY`](#dotnet_host_trace).

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.

### `SuppressNETCoreSdkPreviewMessage`
Expand Down