如何在Visual Studio中导出/导入工具栏 [英] How to Export/Import Toolbars in Visual Studio

查看:237
本文介绍了如何在Visual Studio中导出/导入工具栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio中导出我的设置,如果我搬到新机器上或遇到问题,我会使用这些备份的设置将Visual Studio恢复到我喜欢的方式.它还使我可以在使用的各种机器之间维护一致的开发环境.

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.

有人知道如何备份和还原工具栏的位置和自定义设置吗?如果不是Visual Studio的功能,是否有插件可以完成这项工作?

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?

修改

如下所述,导入和导出设置中的菜单和命令栏自定义应该这样做,但是当我重新导入以前的设置时,

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

错误1:菜单和命令栏自定义:不支持导入的命令栏设置的版本.所有命令栏设置都将被忽略.

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.

本月初,我尝试重新导入的设置已使用相同版本的Visual Studio导出.唯一的区别是,我现在运行的是64位而不是x86.尽管设置文件是XML,但我认为这不会有所作为.

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.

有什么想法吗?

推荐答案

我终于找到了解决方案.在Visual Studio中有一个已知错误,并且有提供了两种解决方法.第一种解决方法不适用,但第二种可行.

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:

将文件 CmdUI.PRF 从路径%AppData%\ Microsoft \ VisualStudio \ X.Y \ 1033 复制到与导出的.settings文件相同的目录中. 其中 X.Y可以是8.0、9.0、10.0或11.0 ,具体取决于您的Visual Studio版本(分别为2005、2008、2010和2012).

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:

确保已关闭Visual Studio,然后将备份的文件复制回原始位置.

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

这篇关于如何在Visual Studio中导出/导入工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆