如何更新书签以指向新位置? [英] How to update bookmarks to point at a new location?

查看:97
本文介绍了如何更新书签以指向新位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将Visual Studio 2012项目复制到新位置时,书签指向旧位置。如何更新书签以指向新位置?

解决方案

如果您尝试保存项目和解决方案,您可以找到书签,断点和其他数据与项目无关,但保存在文件.suo中的解决方案数据中。因此,您只能使用解决方案重新定位项目,相对于新的解决方案文件,保留所有文件的相同路径。之后,您可以使用另存为并将解决方案复制到其他位置。如果你还保留.suo文件,它将起作用。这样,您可以更改所有文件的位置,并更改项目相对于解决方案的相对位置,并保留您的书签。



不幸的是另存为只有在不更改项目文件位置时,项目才有效。如果需要,我会手动移动所有文件并手动修改解决方案文件,但不会保留书签和其他解决方案数据。但它很少需要。只有当您想要更改一个项目的位置并保留其他项目的位置时才需要它,因此它们的相对位置会发生变化。如果你不需要它,你可以使用我在第一段中描述的步骤。



请注意,在漫长的开发周期中保留suo文件不是一件好事。不同的开发者会有不同的数据。像.suo或.user这样的文件不应该转到修订控制数据库,例如,开发人员不应该使用这些数据进行通信。但对于单个开发人员,您可以在项目位置暂时容忍一些不便,直到不再需要此数据的时间点。请记住,不应该是你的一个开发工件,应该严格临时使用,你不应该太依赖它。



-SA

When copying a Visual Studio 2012 project to a new location the bookmarks point to the old location. How do I update the bookmarks to point at the new location?

解决方案

If you experiment with saving projects and solutions, you can find out that the bookmarks, breakpoints and other data are not associated with projects but are saved in the solution data in the file .suo. Therefore, you can only relocate the projects with the solutions, keeping the same relative paths of all files, relative to new solution file. After that, you can use "Save As" and copy the solution to some other location. If you also keep the .suo file, it will work. This way, you change the location of all files, plus changed the relative location of the projects relative to solution and still keep your bookmarks.

Unfortunately "Save As" on a project only works if you don't change the project file location. If I need it, I move all file manually and manually modify the solution file, but then the bookmarks and other solution data is not preserved. But it is rarely needed. It's only needed when you want to change the location of one project and keep the location of some other project, so their relative locations changes. If you don't need it, you can use the steps I described in my first paragraph.

Note that keeping suo files during long development cycle is not a good thing. Different developer will have different data. The files like .suo or .user should not go to revision control database, for example, the developers should not communicate using this data. But for a single developer you can tolerate some inconvenience in project location for a while, until the point of time where this data is no longer needed. Remember, is should not be one of your development artifacts, should be used on strictly temporary basis, you should not rely on it too much.

—SA


这篇关于如何更新书签以指向新位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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