Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Export/Import Toolbars in Visual Studio

Tags:

I export my settings in Visual Studio and if I ever move to a new machine or have problems, I use those backed up settings to restore Visual Studio to the way I like it. It also allows me to maintain a consistent development environment between the various machines that I use.

This works great for keybindings, syntax highlighting, user tools, pretty much everything except for the toolbar locations and customizations. Whenever I move to a new machine and restore the settings, the toolbars are not affected. I have spent a fair amount of time setting up toolbars with my macros, external tools, etc and cut'n'pasted icons in for them. I hate losing all that work.

Does anybody know how to back up and restore the toolbars' locations and customizations? If it is not a feature of Visual Studio, is there an addin that will do the job?

Edit

As mentioned below, the Menu and Command Bar Customizations in Import and Export Settings is supposed to do this, but when I re-import my previous settings, I get

Error 1: Menu and Command Bar Customizations: The version of command bar settings being imported is not supported. All the command bar settings have been ignored.

The settings I am trying to re-import were exported earlier this month with the same version of Visual Studio. The only difference is that I am now running 64 bit as opposed to x86. I didn't think that would make a difference though since the settings files are XML.

Any ideas?

like image 549
Rob Prouse Avatar asked Nov 14 '08 20:11

Rob Prouse


People also ask

How do I add a toolbar in Visual Studio?

Add, remove, or move a toolbarOn the menu bar, choose Tools > Customize. The Customize dialog box opens. On the Toolbar tab, perform one of the following sets of steps: To add a toolbar, choose the New button, specify a name for the toolbar that you want to add, and then choose the OK button.

How do I export Microsoft Visual Studio?

Open the Visual Studio Installer. On the product card, choose the More button, and then select Export configuration.


2 Answers

I have finally found the solution to this. There is a known bug in Visual Studio and there are two workarounds given. The first workaround does not apply, but the second worked.

To Backup your toolbars:

Copy the file CmdUI.PRF from the path %AppData%\Microsoft\VisualStudio\X.Y\1033 to the same directory as your exported .settings file. where X.Y is either of 8.0, 9.0, 10.0 or 11.0 depending on your visual studio version (2005, 2008, 2010 and 2012 respectively).

To Restore your toolbars:

Make sure Visual Studio is closed and copy the backed up file back to the original location.

like image 59
Rob Prouse Avatar answered Oct 20 '22 05:10

Rob Prouse


For the benefit of others, as you mentioned this feature doesn't seem to be supported across versions of Visual Studio, presumably because of a change in the DTD/XSD for the settings file? At any rate, here's where the settings for your custom toolbars lie in the "Import and Export Settings..." dialog:

enter image description here

Note: Your options may look different, depending on the settings you exported.

like image 31
Chiramisu Avatar answered Oct 20 '22 05:10

Chiramisu