User Manual > How to...

Attach to a Process

(Professional only)

Instead of having the profiler launch the process to profile, it is also possible to attach the profiler to an already running .NET Process.

There are two ways of attaching to a process: Attach using profiling API and Attach using Debugging Tools. Attach using profiling API is the recommended option, but it requires the use of .NET Framework 4.0 and that the process is not using concurrent GC. For more information about profiling API attach, see Attach to Process using Profiling API.

In order to attach to a process using the Debugging Tools, the Debugging Tools for Windows must be installed on the computer. These tools can be downloaded from http://www.microsoft.com/whdc/devtools/debugging.

NOTE! On a 64-bit operating system, you will need to download the 32-bit debugging tools to attach to a 32-bit process and the 64-bit debugging tools to attach to a 64-bit process.

After the debugging tools have been installed, the following steps should be performed to attach the profiler to a running process:

1.   Select the Description: AttachToAttach to Process command from the File menu or Attach Profiler to Process from the Profiler menu if running under Visual Studio.

2.   The “Attach to” wizard appears.

3.   Select the process you want to attach to from the list of .NET processes and whether the process should be attached using the profiling API or the Debugging Tools.

4.   If you want to profile using the default settings, click Start to start the application.

5.   If you want to modify settings, you can use the Next button to modify some common settings.

6.   When you have decided on the settings, click Start to attach to the process.

7.   If Debugging Tools attach was selected and the Debugging Tools for Windows is not installed, the dialog below will appear, instructing you to install the debugging tools.

Description: dbgtools