Updated MZ-Tools Article Series: HOWTO: Adding buttons, commandbars and toolbars to Visual Studio .NET from an add-in
I have updated my most popular (by far) article to include information and sample code about how to create permanent commandbars (via Commands.AddCommandBar) instead of temporary commandbars (via CommandBars.Add):
HOWTO: Adding buttons, commandbars and toolbars to Visual Studio .NET from an add-in
I have done this for completeness sake, because as I stated in the previous version of the article, I am not big fan of permanent UI in Visual Studio add-ins and I recommend temporary UI instead, which my MZ-Tools add-in uses. My recommendation against permanent commandbars is now bigger than ever: it took me several hours to get the sample code to work, because if temporary commandbars are difficult to program (as usual), permanent commandbars are even worse, much worse (I didn’t even try to test how to remove them when the add-in is uninstalled, that’s left as exercise for you if interested). You get duplicated commandbars each time you debug the add-in in VS 2005 (as someone else reported in a comment here) thanks to the half baked new /resetaddin command-line switch of VS 2005 that add-in projects use when debugging, which resets the commands and buttons but not the commandbars. Fortunately I managed to solve this, the article shows how.