// Detach is called when debugging is stopped and the process was attached to (as opposed to launched) // or when one of the Detach commands are executed in the UI. public int Detach() { _breakpointManager.ClearBoundBreakpoints(); EventHandler <AD7EngineEventArgs> detaching = EngineDetaching; if (detaching != null) { detaching(this, new AD7EngineEventArgs(this)); } _process.Detach(); _ad7ProgramId = Guid.Empty; return(VSConstants.S_OK); }