Share via


Debugger.DetachAll, méthode

Détache de tous les programmes attachés.

Espace de noms :  EnvDTE
Assembly :  EnvDTE (dans EnvDTE.dll)

Syntaxe

'Déclaration
Sub DetachAll
void DetachAll()
void DetachAll()
abstract DetachAll : unit -> unit 
function DetachAll()

Notes

DetachAll tente de détacher de tous les programmes attachés. Cette opération peut échouer si un processus attaché ne peut pas être détaché. Consultez Comment : détacher tous les processus pour plus d'informations.

Exemples

L'exemple suivant montre comment utiliser la méthode DetachAll.

Pour tester cette méthode :

  1. Utilisez la boucle infinie dans le code d'application cible.

  2. Exécutez l'application cible en mode débogage.

  3. Exécutez le complément.

  4. Le débogueur est détaché de l'application cible.

public static void DetachAll(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("DetachAll Method Test");
    owp.Activate();

    dte.Debugger.DetachAll();
    owp.OutputString("Detached all processes.");
}
Shared Sub DetachAll(ByRef dte As EnvDTE.DTE)
    dte.Debugger.DetachAll()
    MessageBox.Show("Detached all processes.", "Debugger Test - DetachAll Test")
End Sub

Sécurité .NET Framework

Voir aussi

Référence

Debugger Interface

EnvDTE, espace de noms