locked
How to Enable/Disable [Start Debug Target] button from Toolbar in VS2012? RRS feed

  • Question

  • Hi Guys,

    We found a new feature [Start Debug Target] button in VS2012, which looks similar as [Start/Continue].

    We can control the [Start/Continue] button as enabled/disabled according to project's debug mode, but fail to access [Start Debug Target] button from Toolbar.

    Since [Start Debug Target] is supposed to help debugging, we intend to access it like [Start/Continue].

    We use IVsDebuggableProjectCfg.QueryDebugLaunch(uint flags, out int fCanLaunch) to access [Start/Continue] as following,

            public override int QueryDebugLaunch(uint flags, out int fCanLaunch)
            {
                CCITracing.TraceCall();
                fCanLaunch = this.IsDebugConfig ? 1 : 0;
                //fCanLaunch = 0;
                return VSConstants.S_OK;
            }

    Can we find a way to control [Start Debug Target]? e.g. ,QueryDebugLaunch(), filter by VsCommands. in QueryStatus() ...

    For more information, please refer to another link which I raised earlier:

    h t tp://social.msdn.microsoft.com/Forums/windows/en-US/20d174ba-c8ee-4887-87d8-c0c796cc45d9/how-to-enabledisable-start-debug-target-button-from-toolbar-in-vs2012

    Please correct me if I'm wrong, thanks in advance!

    Tuesday, September 10, 2013 1:33 AM

Answers

  • "Start Debug Target" is available on "Standard|Debug Target" toolbar and there is no straightforward way to enable or disable it. If your customer has added it manually by add commands, you may think about disable it by changing button status.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Regards,
    Jacky Wu
    Microsoft Online Community Support


    Wednesday, September 25, 2013 8:54 AM

All replies

  • Hi Guys,

    We found a new feature [Start Debug Target] button in VS2012, which looks similar as [Start/Continue].

    We can control the [Start/Continue] button as enabled/disabled according to project's debug mode, but fail to access [Start Debug Target] button from Toolbar.

    Since [Start Debug Target] is supposed to help debugging, we intend to access it like [Start/Continue].

    We use IVsDebuggableProjectCfg.QueryDebugLaunch(uint flags, out int fCanLaunch) to access [Start/Continue] as following,

    Can we find a way to control [Start Debug Target]? e.g. ,QueryDebugLaunch(), filter by VsCommands. in QueryStatus() ...

    Please correct me if I'm wrong, thanks in advance!

    • Edited by Jason.S.W Monday, September 9, 2013 6:41 AM update
    • Merged by Jane Wang - MSFT Tuesday, September 10, 2013 3:06 AM repeated
    Monday, September 9, 2013 6:31 AM
  • Hi Jason,

    I have merged the same issue into one thread for better response.

    Thanks for your understanding and support.

    Have a good day.

    Jane.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, September 10, 2013 3:09 AM
  • Hello,

    According to your description, you want to find a way to enable & disable the [Start debug target] in toolbar.

    And I tried to reproduce with steps below according to your sharing screenshot above.

    1.  Open tools, click customize, check toolbar tab and check the ‘debug’ item;
    2. Check commands tab and  check toolbar line and select debug item;
    3.  Add new command , select the ‘Start debug target’ item, click close;
    4.  See that there is a new button showing in toolbar and it is enabled.

    As for more details, please refer to the below screen shot:

    Could you please put mouse on the grey button and check whether it is with ‘start’? Or whether your visual studio currently is in with debug status?

    And you could consider doing with those steps I mentioned above and seeing whether it is still disabled.

    If I misunderstood you, please feel free let me know.


    Sophia Gou <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED> MSDN Community Support Please remember to "Mark as Answer" the responses that resolved your issue.

    Tuesday, September 10, 2013 9:23 AM
  • Thanks Sophia,

    I believe you may misunderstand my question.

    I'm working a VSpackage project with own project type and debugger. I can control the status of start debuger icon (enable/disable) from QueryDebugLaunch in VS2010, but now in VS2012, I find there is a new one called "Start Debug Target". I belive it is totally a new one from VS2012.

    My question is how to disable this button (make it disable) from code. Is there any interface MSFT should recommand to implement?


    Thursday, September 12, 2013 4:18 AM
  • I will try to involve some senior engineer into this case. Thanks for the patience!



    Sophia Gou <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED> MSDN Community Support Please remember to "Mark as Answer" the responses that resolved your issue.

    Friday, September 13, 2013 9:11 AM
  • Thanks guys,

    could I get some comments on this now?

    Monday, September 23, 2013 9:01 AM
  • "Start Debug Target" is available on "Standard|Debug Target" toolbar and there is no straightforward way to enable or disable it. If your customer has added it manually by add commands, you may think about disable it by changing button status.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Regards,
    Jacky Wu
    Microsoft Online Community Support


    Wednesday, September 25, 2013 8:54 AM