Skip to content
William Xie edited this page Aug 16, 2018 · 4 revisions

If you are still encountering issues, please contact [email protected].

What is the CLR?

CLR stands for the Common Language Runtime. It is runtime for Microsoft's .NET framework and provides execution support for programs written in managed .NET languages such as C#, C++ CLI, F#, and VB.Net. Compiling code written in a managed language results in bytecode called the Common Intermediate Language (CIL). The CIL is platform and processor independent and it is up to the CLR to Just-In-Time (JIT) compile the CIL into native code specific to the hardware platform and processor in order to be executed. The CIL and the CLR together make up the Common Language Infrastructure (CLI).

In addition to the CLR (which supports the full .NET Framework), Microsoft has also released CoreCLR (which supports .NET Core).

What is the CLR Instrumentation Engine?

The CLR exposes a profiling API which reports events and messages of what is happening to during the execution of a managed process or application (such as what methods are JIT compiled or if a class is loaded). The problem is that only one profiler can interact with the CLR Profiler APIs at a time. The CLR Instrumentation Engine was written to address this by acting as a host and inverse multiplexes the APIs for multiple profiler clients.

See the MSDN Profiling Overview for more details.

How do I enable the CLR Instrumentation Engine?

When a managed process starts execution, it must first load the CLR. Once the CLR is initialized, it then checks environment variables to see if a Profiler should be loaded.

These are the environment variables and values that are required to enable the CLR Instrumentation Engine:

  • COR_ENABLE_PROFILING = 1
  • COR_PROFILER = "{324F817A-7420-4E6D-B3C1-143FBED6D855}
  • COR_PROFILER_PATH_32 = "[PATH TO MicrosoftInstrumentationEngine_x86.dll"
  • COR_PROFILER_PATH_64 = "[PATH TO MicrosoftInstrumentationEngine_x64.dll" (Here are the corresponding environment variables for CoreCLR)
  • CORECLR_ENABLE_PROFILING = 1
  • CORECLR_PROFILER = "{324F817A-7420-4E6D-B3C1-143FBED6D855}
  • CORECLR_PROFILER_PATH_32 = "[PATH TO MicrosoftInstrumentationEngine_x86.dll"
  • CORECLR_PROFILER_PATH_64 = "[PATH TO MicrosoftInstrumentationEngine_x64.dll"

These are the environment variables and values that are required to make the CLR Instrumentation Engine work:

  • MicrosoftInstrumentationEngine_Host = ="{CA487940-57D2-10BF-11B2-A3AD5A13CBC0}"
  • MicrosoftInstrumentationEngine_HostPath_32 = "[PATH TO Microsoft.InstrumentationEngine.ExtensionsHost_x86.dll]"
  • MicrosoftInstrumentationEngine_HostPath_64 = "[PATH TO Microsoft.InstrumentationEngine.ExtensionsHost_x64.dll]"
  • MicrosoftInstrumentationEngine_LogLevel = "Errors"
  • MicrosoftInstrumentationEngine_ConfigPath32_[NAME OF CLIENT PROFILER] = "[PATH TO .config FILE FOR 32 BIT]"
  • MicrosoftInstrumentationEngine_ConfigPath64_[NAME OF CLIENT PROFILER] = "[PATH TO .config FILE FOR 64 BIT]"