Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Debugger.LocalProcesses Property

Gets the list of processes currently running on this machine.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

Processes LocalProcesses { get; }
/** @property */
Processes get_LocalProcesses ()

function get LocalProcesses () : Processes

Property Value

A Processes collection.

LocalProcesses returns a Processes collection containing a list of processes running on this machine. Each process in the list might or might not be currently debugged. To get the subset of processes that are being currently debugged, use the DebuggedProcesses property.

The following example demonstrates how to use the LocalProcesses property.

To test this property:

  1. Open the target project and run the add-in.

public static void LocalProcesses(DTE dte)
{
    // Setup the debug Output window.
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("Local Processes Test");
    owp.Activate();

    EnvDTE.Processes processes = dte.Debugger.LocalProcesses;
    if(processes.Count == 0)
        owp.OutputString("No processes are running on this machine.");
    else
    {
        owp.OutputString("Processes running on this machine:");
        foreach(EnvDTE.Process proc in processes)
            owp.OutputString("\nProcess: [" + proc.ProcessID + "] " + 
                             proc.Name);
    }
}

Community Additions

ADD
Show:
© 2015 Microsoft