Hello @AdamJachocki-5815 ,
Thank you for taking time to post this issue in Microsoft Q&A forum.
I think your requirement is like right-clicking one of the projects in your solution, and in the shortcut menu select one “option” and this project will be marked.
To add a button
in shortcut menu of project(by right-clicking project), you can refer to this document: Add a command to the Solution Explorer toolbar(Add a button to the Solution Explorer toolbar), since this document indicates that add a button to the Solution Explorer toolbar, you can refer to this document: IDE-Defined Commands for Extending Project Systems(Shortcut Menus) and modify the IDM_VS_TOOL_PROJWIN
to IDM_VS_CTXT_PROJNODE
to let this button displays in right-click shortcut menu.
And for the detailed logic of marking the specified project, you need to write the related codes in .cs
(if you use C#) file which you added to your VSIX project as a menu command item template(For this sample is ToolbarButton.cs file). Focus on the Execute()
method, and write your codes there, this function is the callback used to execute the command when the menu item is clicked.
Besides, I think you will need to check these APIs: Visual Studio SDK API Reference version 2019.
I hope this could help you a little.
Best Regards,
Tianyu
- If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.