Dec 7, 2010 at 2:07 PM
Edited Dec 8, 2010 at 9:31 AM
I'm working with VS 2010 final.
Well, there is another way to get the add-in working with VS 2010. The Addin try to get the command bars according to their GUID. It seems to work for previous version of VS but fails for "tools" menu in VS 2010.
The work around i've found is the following :
In the WSPools.VisualStudio.VSAddin.VSMenuHandler class, go to the "GetCommandBar" method with following signature : Public CommandBar GetCommandBar(MenuItemDefinition menuDefinition)
There are two nested try/cach blocks. In the second one, replace the try block code by the following one :
CommandBar menuBarCommandBar = ((Microsoft.VisualStudio.CommandBars.CommandBars)ApplicationObject.CommandBars)["MenuBar"];
//Find the command bar on the MenuBar command bar:
CommandBarControl cbc = menuBarCommandBar.Controls[menuDefinition.Name];
CommandBarPopup cbp = (CommandBarPopup)cbc;
bar = cbp.CommandBar;