Debugger2::Stop Method (Boolean)

 

Stops debugging and terminates or detaches from all attached processes.

Namespace:   EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

void Stop(
	bool WaitForDesignMode = true
)

Parameters

WaitForDesignMode
Type: System::Boolean

Set to true if the debugging session should stop only when it reaches Design mode. Set to false if you intend to stop debugging, but you need to perform other tasks in the macro even before the debugger enters design mode.

The following example demonstrates how to use the Stop method.

No code example is currently available or this language may not be supported.
System_CAPS_noteNote

Macros are run on the main thread of Visual Studio. The following code does not work and the macro loops indefinitely because the IDE never has a chance to enter design mode. Instead, resort to a separate thread or pooling mechanism.

' Bad Code Example.
Sub StopDebuggingAndWaitForDesign
    DTE2.Debugger.Stop(False)

    While DTE2.Debugger.CurrentMode <> dbgDebugMode.dbgDesignMode
        System.Threading.Thread.Sleep(50)
    End While

    MsgBox("Debugger has been stopped")
End Sub
Return to top
Show: