Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Attaching to Running Processes

This topic applies to:

Edition

Visual Basic

C#

C++

Web Developer

Express

Topic does not applyTopic does not applyTopic does not applyTopic does not apply

Standard

Topic appliesTopic applies

Topic applies

Topic applies

Pro and Team

Topic appliesTopic applies

Topic applies

Topic applies

Table legend:

Topic applies

Applies

Topic does not apply

Does not apply

Topic applies but command hidden by default

Command or commands hidden by default.

The Visual Studio debugger has the ability to attach to a process that is running outside of Visual Studio. You can use this attach capability to do the following:

  • Debug an application that was not created in Visual Studio.

  • Debug multiple processes simultaneously. You can also debug multiple processes by starting multiple projects within a single solution.

  • Debug a process running on a remote computer.

  • Debug a DLL that runs in a separate process that cannot easily be started from Visual Studio, for example, a service or an ISAPI DLL running with Internet Information Services.

  • Start the debugger automatically when a process crashes while running outside of Visual Studio. This is Just-In-Time debugging.

After you have attached to a program, you can use debugger execution commands, inspect the program state, and so on. For more information, see Execution Control and Viewing Data in the Debugger. Your ability to inspect the program may be limited, of course, depending on whether the program was built with debug information and whether you have access to the program's source code, and whether the common language runtime JIT compiler is tracking debug information.

NoteNote:

For the debugger to attach to code written in C++, the code needs to emit DebuggableAttribute. You can add this to your code automatically by linking with the /ASSEMBLYDEBUG linker option.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft