New Edition of Managed Menu Extensions for Visual Studio 2010
The Main goal of "MME" is to provide easy access to adding Right Click menus in the Visual Studio Solution Explorer.
This is accomplished using MEF. All you have to do is implement a simple interface with 2 methods.
MME replaces Managed Menu Extensions
Back in 2007 I created the project Managed Menu Extensions
to make it easier to create custom menu items in the Solution Explorer of Visual Studio 2008. Back then I used the brand new System.AddIn namespace also known as MAF to accomplish this goal.
Now I have upgraded this project to Visual Studio 2010. I have chosen to move it to this new site because it is re-developed from the ground up since I now use MEF instead of MAF. MEF has allowed me to make it even easier to create menu items for the solution explorer. Furthermore it now also provides menus for the Codewindow (but that feature is currently only in the source code until the next install is ready for download).
MAF has some advantages over MEF like better Isolation through use of different AppDomains, and an advanced versioning model. But MAF is more complex and I believe not needed for most scenarios involving right click menus. That's is why I went with MEF instead.
- Hides Complexity. Installs a Visual Studio Add-In which works behind the scenes and uses MEF to load extensions.
- Ease of use. You just implement one interface, IMenuManager which contains 2 methods and place the resulting assembly in a directory.
- More powerful. The full DTE object is passed to the implemented IMenuManager if you need it. But you can also use the simpler model you (may) know from Managed Menu Extensions.
- One installer. Though I also provide a seperate Project Template on the Visual Studio Gallery.
- Simpel. My ambitions was to provide MenuItems for all kinds of things. Windows Explorer, SharpDevelop and others. But in this edition I focus on the prime target Visual Studio 2010.
Installing your own Menu Extension
When you have created an assembly containing one or more classes implementing IMenuManager, you have to place it in 1 of 3 locations:
- You can place it in the same folder as a Visual Studio Solution file (.sln). In this case the Menus will only appear when you open that solution.
- You can place it one folder level above one or more solution files. Then the menus will appear in all the solutions of the subfolders.
- You can place it in the MME subfolder of the CommonAppDataFolder (typically C:\ProgramData\MME). Then the menus appear in all solutions on the machine.
MMETools and MMECommunityTools
As a little extra bonus MME contains some menus already implemented. First there is the MME Tools which much like other power tools for Visual Studio contains "Open in file location", "Open in notepad" and search with google or bing.
Secondly there is the community tools. Currently these consists of the Web Deployment Helpers provided by
Lionel Limozin : email@example.com
Sebastien Reynier : firstname.lastname@example.org
From BEWISE (www.bewise.fr)
They provide Recycling of App pools in the IIS, and Attaching the debugger to the IIS process + adding the assembly generated byt the current project to the GAC. These tools are for the situation when you are developing directly on a machine with IIS, a SharePoint developer would typically find himself in that situation.
Currently the tools can be found only in the source code. They can be viewed as tools in their own right, but are also great examples of the power of MME and how easy it is to implement right click menus for Visual Studio.