How to access selected project in Solution Explorer from a Visual Studio Add-In? - visual-studio

I developed a VS 2008 add-in and added a custom menu item to context menu for "Project" nodes in Solution Explorer.
This allows me to right-click any project in solution and perform a custom operation on that project. Or at least, it would, if I knew how to access the selected project from my Click event handler.
Can someone with more experience please help me?

I think what you're looking for is DTE.ActiveSolutionProjects.

Related

why Visual studio 2019 missing SQL Service-Based-Database

I am trying to make a Login form in visual studio and I watched few videos and it says that I need to use the SQL server data tool/Service-Based-Database in the solution item section but seems like it's not there. I already checked and it is installed already, anyone knows what I'm doing wrong or what other step should I take?
This is what I am looking for exactly:
You are trying to add a "Solution Item" - you likely right clicked on your Solution in solution explorer, rather than one of your projects. If you right click on your actual project in solution explorer and attempt to add an item, you should be able to see the Service-based Database.
So do one of the following:
Right click on your project in solution explorer and select Add → New Item. Then find the Service-based Database item.
Left click on your project in solution explorer to select it, then in the top menu bar of Visual Studio, click the Project menu item, then Add new item and find the Service-based Database.

How to reset the context menu in VisualStudio to have default items?

Am using VisualStudio 2013, update2. I am facing the below issue when I opened a project in VisualStudio today, I noticed on right clicking a project in the SolutionExplorer the context menu have a lot of options that even have scrolling now. Now I have to scroll down everytime to build or clean a project.
Earlier it was like a short menu like below.
I have not changed any settings but don't know why am facing this issue. I tried to customize the context menu command and chose (Project and solution context menus | Project) from the drop down, but that didn't worked out as it is automatically reset to tfs on clicking the close button. Does any one have idea about how to rectify this?
Note: The context menu has changed only for the projects inside the solution. On right clicking the solution name in solution explorer, I am still getting the same old menu.
From looking at your context menu screenshot, it looks like you have some extensions installed that have introduced these commands. Try disabling some or all of them in Tools > Extensions and Updates Manager to see which ones belong to which extension. There unfortunately isn't a way right now to customize this context menu.
Thanks,
Cathy
Visual Studio IDE Team

Adding context menu for VS 2010 Add-In on loading

I'm creating an Add-In for Visual Studio 2010.
I want to add the context menu item to the tab during Add-In loading
(in OnConnect method of the Add-In):
I do know how to add the menus using CommandBars.
I already added commands into "Tools" and "Solution Explorer" menus.
I just cannot find the CommandBar responsible for the menu, I need.
Can anybody help me?
Solution found.
You can enable logging of chosen menus.
Details:
http://blogs.msdn.com/b/dr._ex/archive/2007/04/17/using-enablevsiplogging-to-identify-menus-and-commands-with-vs-2005-sp1.aspx
http://blogs.msdn.com/b/dr._ex/archive/2007/04/17/using-ivsproffercommands-to-retrieve-a-visual-studio-commandbar.aspx

Extending VisualStudio

I want to extend Visual Studio such that, when someone right clicks on Solution Explorer, context menu should have a new menu item, say "Open custom form", clicking which should open a form (this form would actually accept some settings and modify config file accordingly)
Q1. Please provide on where should I start for such extension. Couldn't find any reference/tutorial link :(
Q2. What technology can be used to make such a form - Winforms/WPF?
Either Windows Forms or WPF should be fine.
SO: Visual Studio Add-In - adding a context menu item to solution-explorer
Google Code: explorer-popup-add-in
There's a lot of docs on Visual Studio integration here

visual studio add on

I want to know if this is possible. I have a small piece of software that I have written, that would work well if it can be incorporated into visual studio as an add-on. Is it possible to create an add-on that when the user right clicks on a project, the drop down menu includes an option to select my add-in?
Thanks
Here you go!
http://msdn.microsoft.com/en-us/library/bb165922.aspx is all about extending Solution Explorer.

Resources