Debugger3.Break Method (Boolean)
Causes the given process to pause its execution so that its current state can be analyzed.
Assembly: EnvDTE90 (in EnvDTE90.dll)
Parameters
- WaitForBreakMode
- Type: System.Boolean
Set to true to return only when the debugger has entered break mode. Set to false to break and return immediately. For more information, see How to: Break Execution.
Implements
Debugger2.Break(Boolean)The following example shows how to use the Break method.
To test this method:
-
Use the infinite loop in the target application code.
-
Run the target application in the debug mode.
You cannot examine any values of variables while the target is running.
-
Run the add-in. Examine the values of variables.
public static void Break(EnvDTE80.DTE2 dte) { // Setup 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("Break Method Test"); owp.Activate(); EnvDTE90.Debugger3 debugger = (EnvDTE90.Debugger3)dte.Debugger; debugger.Break(false); owp.OutputString("The process is paused. Examine the values of variables."); }
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.