This documentation is archived and is not being maintained.

Profiling in the .NET Framework 4

The .NET Framework version 4 includes the following new profiling features:

  • Profiler Attach and Detach: The ability to attach a profiler to a running process, and to detach a profiler before the process exits. This is generally limited to sampling and memory profiling scenarios, and is not supported for profilers that use instrumentation.

  • In-Process Side-by-Side Profiling: Support for profiling multiple side-by-side, in-process common language runtime (CLR) instances.

  • Registry-Free Profiler Startup and Attach: The ability to load profilers without having to first add keys to the registry.

  • Profiling with the ELT API: Updated enter/leave/tailcall probe signatures that decrease the size of the just-in-time generated code.

In addition, a new environment variable (COMPLUS_ProfAPI_ProfilerCompatibilitySetting) enables provisional use of .NET Framework versions 2.0, 3.0, and 3.5 profilers in the .NET Framework 4. For more information, see Profiler Compatibility Settings.

A profiler is considered to be a .NET Framework 4 profiler if it exposes an implementation of the ICorProfilerCallback3 interface to the CLR through its class factory object and QueryInterface implementation.

Important noteImportant

A .NET Framework 4 profiler must handle the new features in the .NET Framework 4 correctly. Most notably, the profiler must offer some level of support for scenarios that involve multiple in-process side-by-side CLR instances. For more information, see In-Process Side-by-Side Execution.