Exploring the .NET boot process via host tracing The article explains how to enable host tracing in .NET by setting the `COREHOST_TRACE=1` environment variable, which provides detailed diagnostic logs about the early boot process of a .NET application. It describes how to configure trace output to a file using `COREHOST_TRACEFILE` and adjust verbosity with `COREHOST_TRACE_VERBOSITY`. The post then uses this tracing feature to explore the startup sequence, including the roles of the `dotnet` muxer, `hostfxr`, and `hostpolicy` components in loading the .NET runtime. In this post we take a look a look at how you can enable diagnostics for the .NET host itself that you can use to debug issues running your .NET applications. We then use the tracing diagnostics to explore the boot process of a simple .NET application. Understanding the boot process with tracing understanding-the-boot-process-with-tracing The main focus of this post is to show the the host tracing feature https://github.com/dotnet/runtime/blob/25cae043b11fa5e4fbda011376a7ad403438bd62/docs/design/features/host-tracing.md available in modern .NET. This isn't "tracing" like OpenTelemetry or APM solutions with activities and spans, this is old school tracing, i.e. logging.πŸ˜„ Host tracing provides you detailed diagnostic information about the very early steps of a .NET application's "boot" process. This can be useful if you're trying to understand why your application is using the "wrong" version of .NET, for example. You won't need it often, but it can be invaluable when things aren't working the way you expect In this post I'm going to explore the startup process for a simple .NET app by looking at the host tracing output. It's going to be intentionally verbose, but it will give you an idea of what's available. Enabling host tracing requires setting a single environment variable: COREHOST TRACE=1 . By default this writes the traces to stderr , but you can redirect that output to a file by setting COREHOST TRACEFILE to one of two values: COREHOST TRACEFILE=