I want to add a new option in Visual Studio 2010’s solution explorer’s context menu for a specific file type. So for example, right clicking on a *.cs file will show the existing context menu plus “my new option”.
I’m wondering what the code would look like; and would love a pointer to a good reference for developing visual studio plug-ins. The tutorials/references I’m seeing are conspicuously horrid.
Thanks!
It took me about 5 hours to do this.
There are 2 options, Visual studio Add-in (or shared Add-in) vs Visual studio package.
The package is far more complicated to give you far more control, but for a context menu on the solution explorer it is not needed.
So new project-> Other Project Types -> Extensibility -> Visual Studio Add-in.
Here’s a walk-through – Link
Also This one I followed some – Link
I recommend you leave on the option for add to tools menu until you have the context menu working, or to provide a place to put a settings dialog (if you don’t write a Tool-> options page.
Here’s the connection code:
This code checks to see if what the user has selected is a project for instance:
Note that certain string names in your code have to match up and I’m not sure which ones they are quite yet as I just did this yesterday.