When using Regionerate with other extensions in Visual Studio, it’s not uncommon to run into the following error dialog:
A problem occured while trying to initialize menus.
System.ArgumentException: A Command with that name already exists.
at EnvDTE80.Commands2.AddNamedCommand2(AddIn AddInInstance,
String name, String ButtonText, String Tooltip, Boolean MSOButton,
Object Bitmap, Object[]& ContextUIGUIDs, Int32 vsCommandStatusValue,
Int32 CommandStyleFlags, vsCommandControlType ControlType)
at Rauchy.Regionerate.Presentation.Addins.VisualStudio2005.Connect.
OnConnection(Object application, ext_ConnectMode connectMode,
Object addInInst, Array& custom)
You may have to restart Regionerate.
This error dialog appeared every single time Visual Studio was opened and sometimes appeared underneath my currently focused window, forcing me to minimize all my windows, find the dialog and close it so that Visual Studio could continue loading whatever solution I’d just opened.
Doing this multiple times a day turned out to be pretty grating, so I present to you… a solution! (Haha, get it?! It’s a solution… and it’s Visual Studio, so they’re called solutions… it’s funny.)
I am currently using Microsoft Visual Studio 2010 Ultimate SP1 and Regionerate v0.7.3.0 Beta 2.
This solution may work with other versions of Visual Studio, but I wouldn’t use other versions of Regionerate. I’ve tested neither, so use at your own risk.
Steps to remove the menu error dialog:
Install Regionerate v0.7.3.0 Beta 2: rgn-v0.7.3.0.msi.
Hop on over to your install directory, which by default is
C:\Program Files (x86)\Regionerate. (If you’re not on 64-bit Windows, it’ll be in regular oleProgram Files.)Create a backup of
Regionerate.Presentation.Addins.VisualStudio2005.dll.Download newregioneratedll.zip anywhere on your computer.
Unzip
newregioneratedll.zipand you should now have a brand spankin’ newRegionerate.Presentation.Addins.VisualStudio2005.dll.1Copy-pasta that into your
Regioneratedirectory and overwrite the old, creaky one.Enjoy never having to cancel that error dialog ever again.
Thanks to the Regionerate team for making such an awesome, free, open-source tool. Much appreciated!
-
For those of you that don’t trust a random DLL that you downloaded from the internet (which you really shouldn’t), you can make the change yourself as Regionerate’s source is freely available to all.
The only modification made was to comment out line 198 in
Connect.csunder thePresentation.Addins.VisualStudio2005project. ↩