locked
Extending the "Start Debugging" menu in custom project type RRS feed

  • Question

  • I created a new project type based on mpf framework for Visual Studio 2012. In the new project type, I was able to customize the "Start Debugging" action to meet new project type needs by implementing IVsDebuggableProjectCfg.

    Now I have one action in "Start Debugging" menu, which is "Start".

    I need to extend the the "Start Debugging" menu to include different flavors of "Start Debugging" actions; something similar to C++ projects:

    Should I create a new menu and hide the existing one, or there is a way to extend the existing start menu?

    Any suggestions?

    Thanks

    Thursday, December 5, 2013 2:22 PM

Answers

  • I was having the same problem. The targets would appear in the menu but SetCurrentDebugTarget was never called and the default target was not highlighted.

    Re-reading the documentation I noticed this:

    These [new debug target type commands] definitions are made in the standard way (that is, using a .vsct file) for adding new commands for the IDE, but with the following special requirements:
    The commands should be owned by the debug target handler package.

    So the Commands element's package attribute in the vsct must use the Debug Target Handler Package Guid (guidDebugTargetHandlerCmdSet in the example).
    I was using the Guid of the package containing the vsct ...

    <Commands package="guidDebugTargetHandlerCmdSet">
        <Buttons>
            <!-- -->
        </Buttons>
    </Commands>
    Once I fixed the Guid, the menu was displayed as expected and SetCurrentDebugTarget is called when a target is selected.

    Wednesday, January 8, 2014 9:48 PM

All replies

  • Hi,

    >>Now I have one action in "Start Debugging" menu, which is "Start".

    >>I need to extend the the "Start Debugging" menu to include different flavors of "Start Debugging" actions; something similar to C++ projects:

    Could you clarify the description above with more details,such as a screenshot about the custom debugger you have created?

    If you want to add event to the menu control, please refer to Dynamically menu binding and How to Create an Event for a User Control .

    >>Should I create a new menu and hide the existing one, or there is a way to extend the existing start menu?

    Do you mean that you want to override the current debugger option?

    If so, I think you need to extend the current debugger system.

    The following are some related links :

    Getting Started with Debugger Extensibility

    How to catch the "start debug" button on a custom project template ? (VS 2012)

    If I have any misunderstanding, please feel free to let me know.

    Best Regards,

    Jane.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 6, 2013 8:02 AM
  • Hi Jane,

    Thank you for this info.

    I didn't create a custom debugger. I used an existing debugger - the script debugger. The start menu now looks like this:

    What it does now is to start the project locally - on the development machine.

    What I need is to allow the user to start the project on different targets:

    1- locally on the development machine

    2- on the emulator

    3- on the connected device

    So I need the start menu to show these three options - like C++ projects. The menu should allow the user to change the selected option  - like C++ projects.

    So I have two inquiries:

    1- How to make the start menu to show this list of options for projects created from the new custom project type.

    2- How to access the selected option when the user starts the project (in IVsDebuggableProjectCfg.DebugLaunch). Based on this option, the project will be deployed to and started on the target device.

    Thank you.

    Tuesday, December 10, 2013 3:39 PM
  • Hi,

    Thank you for your feedback.

    Please forgive my lack of experience,this issue is beyond my ability.

    I have delivered this case to the team members who have rich technical experience for better response, which might take some time.

    All of us here would appreciate your patience.

    Best Regards,

    Jane.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, December 12, 2013 1:37 AM
  • Thanks Jane. I really appreciate your help and efforts. Please forgive me if I was not clear in describing my issue- English is my second language.

    Thanks again.

    Thursday, December 19, 2013 1:07 PM
  • Hi,

    I managed to add targets into the Start Debug drop down menu by implementing interface IVsProjectCfgDebugTargetSelection on my project's ProjectConfig class.

    -Philippe

    Thursday, December 19, 2013 7:11 PM
  • Thanks Jane. I really appreciate your help and efforts. Please forgive me if I was not clear in describing my issue- English is my second language.

    Thanks again.

    Thanks for your kind reply.

    Frankly speaking, your English is good enough to make me comprehend the description.

    It is my poor technical skills that don't allow me to solve this issue.

    Hi,

    I managed to add targets into the Start Debug drop down menu by implementing interface IVsProjectCfgDebugTargetSelection on my project's ProjectConfig class.

    -Philippe

    Hi Philippe,

    Could you please share your ideas with us here?

    Sincerely,

    Jane.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 20, 2013 1:21 AM
  • Hi Philippe,

    Thanks for your helpful info.

    I managed to implement IVsProjectCfgDebugTargetSelection interface and my debug targets are shown in the start menu. However, when I change the selected debug target manually using the start menu, the menu is not updated, that is, the selected debug target in the menu does not change and is always the default one. I expect VS to call SetCurrentDebugTarget on my project config which implements IVsProjectCfgDebugTargetSelection when I change the debug target manually in the start menu, but it has never been called by VS.

    Your help is appreciated.

    Monday, December 30, 2013 5:36 PM
  • I was having the same problem. The targets would appear in the menu but SetCurrentDebugTarget was never called and the default target was not highlighted.

    Re-reading the documentation I noticed this:

    These [new debug target type commands] definitions are made in the standard way (that is, using a .vsct file) for adding new commands for the IDE, but with the following special requirements:
    The commands should be owned by the debug target handler package.

    So the Commands element's package attribute in the vsct must use the Debug Target Handler Package Guid (guidDebugTargetHandlerCmdSet in the example).
    I was using the Guid of the package containing the vsct ...

    <Commands package="guidDebugTargetHandlerCmdSet">
        <Buttons>
            <!-- -->
        </Buttons>
    </Commands>
    Once I fixed the Guid, the menu was displayed as expected and SetCurrentDebugTarget is called when a target is selected.

    Wednesday, January 8, 2014 9:48 PM
  • Hi,

    I am having a custom project template and in need of the same scenario as you explained above (showing list of options for start instead of just "start"). Could you please share any reference links for achieving this.

    Thanks in advance.

    Regards,

    Samsudeen K S


    Thursday, April 30, 2015 10:57 AM