locked
How to control Stop Debug in Visual Studio Extension RRS feed

  • Question

  • Hello, %username%.

    I'm writing Visual Studio extension (VS2010) for working with my own project types and I'm interested in question of handling information about stopping or starting debug process.
    I use default debugger from Visual Studio and don't want to write own debugger extension.

    My solutions were:

    1. Using interface IVsDebugger
    2. Using EnvDTE object and its Property Events.DebuggerEvents

    And ALL this solutions inform me about stopping debug after closing application under debugging. If you already guessed, I want to receive control to my code before actual closing application, do you know how I can do it?

    Thank you all in advance for your suggestions,
    Eugene.

    P.S.: If you want see my code working with these solutions, I can post it.

    Tuesday, April 17, 2012 8:28 AM

Answers

  • It sounds like you want to handle the actual stop/start debugging command, not sign up for events (those events would happen after debugging has already started/stopped, as you mentioned).  You can register a priority command handler (IVsRegisterPriorityCommandTarget) and listen for the Exec called on those commands.

    Ryan

    Wednesday, April 18, 2012 7:01 PM

All replies

  • Hi Eugene,

    I am moving your thread into the Visual Studio Extensibility Forum for dedicated support. Thanks for your understanding.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, April 18, 2012 8:48 AM
  • It sounds like you want to handle the actual stop/start debugging command, not sign up for events (those events would happen after debugging has already started/stopped, as you mentioned).  You can register a priority command handler (IVsRegisterPriorityCommandTarget) and listen for the Exec called on those commands.

    Ryan

    Wednesday, April 18, 2012 7:01 PM
  • Thank you, Ryan, for your reply.

    This is great advice for me, it works!

    But received information surprised me little, because I implemented interface IOleCommandTarget and began to log all actions in VS (GUID and cmdIndex of operation). Stop debug matches for 5efc7975-14bc-11cf-9b2b-00aa00573819 GUID (it is Microsoft.VisualStudio.Project.VsMenus.guidStandardCommandSet97) and 179 cmdIndex (it is Stop), but comments for Stop command are:

    //
    // Summary:
    //     Stop webscope rendering.
    Stop = 179,

    It makes me LOL.

    Thanks yet one time, Ryan, for your great advice.

    Thursday, April 19, 2012 4:11 PM