简体   繁体   English

在visual studio 2013中进行备份的最简单方法是什么?

[英]What is the easiest way to make a backup in visual studio 2013?

I want to make a backup from the whole project. 我想从整个项目中备份。 I also need to rename every backup. 我还需要重命名每个备份。 I'dont like the way to copy the project folder and rename the folder and the project file. 我不喜欢复制项目文件夹并重命名文件夹和项目文件的方法。 I've already tried to make it like that: http://jasonfaulkner.com/VisualStudioExpressProjectBuildBackups.aspx 我已经尝试过这样做: http//jasonfaulkner.com/VisualStudioExpressProjectBuildBackups.aspx

But it doesn't work, I am always getting the error "Invalid parameters" 但它不起作用,我总是得到错误“无效的参数”

Does anyone already tried this? 有没有人试过这个?

Thanks 谢谢

The DPack extension for Visual Studio includes the Solution Backup tool that creates a zip archive of the solution and auto names it. Visual Studio的DPack扩展包括解决方案备份工具,该工具可创建解决方案的zip存档并自动为其命名。

在此输入图像描述

Just use source control. 只需使用源代码控制。

Once you have that you can arrange backing up source control server in case hard disk or other hardware/software/service failure. 完成后,您可以安排备份源控制服务器,以防硬盘或其他硬件/软件/服务出现故障。

There are plenty to choose from: subversion, TFS, git, google code, bitbucket (these are just the most popular, but there are tens if not hundreds of others). 有很多可供选择:颠覆,TFS,git,谷歌代码,bitbucket(这些只是最受欢迎的,但有几十个,如果不是几百个)。

Manually edit .sln file 手动编辑.sln文件

This method is entirely aimed at renaming the directory for the project, as viewed in Windows Explorer. 此方法完全旨在重命名项目的目录,如Windows资源管理器中所示。

This method does not suffer from the problems in the Remove/add project file method below (references disappearing), but it can result in problems if your project is under source control (see notes below). 此方法不会遇到下面的删除/添加项目文件方法中的问题(引用消失),但如果您的项目受源代码控制,则可能导致问题(请参阅下面的注释)。 This is why step 2 (backup) is so important. 这就是第2步(备份)如此重要的原因。

1- Close Visual Studio. 1-关闭Visual Studio。

2- Create a backup of your .sln file (you can always roll back). 2-创建.sln文件的备份(您可以随时回滚)。

3- Imagine you want to rename directory "Project1" to "Project2". 3-想象一下,您想要将目录“Project1”重命名为“Project2”。

If not using source control, rename the folder from "Project1" to "Project2" using Windows Explorer. 如果不使用源代码管理,请使用Windows资源管理器将文件夹从“Project1”重命名为“Project2”。

4- If using source control, rename the folder from "Project1" to "Project2" using the functions supplied by source control. 4-如果使用源代码管理,请使用源代码管理提供的功能将文件夹从“Project1”重命名为“Project2”。 This preserves the history of the file. 这会保留文件的历史记录。 For example, with TortoiseSVN, right click on the file, select TortoiseSVN .. Rename. 例如,使用TortoiseSVN,右键单击该文件,选择TortoiseSVN ..重命名。

5- In the .sln file, edit all instances of "Project1" to be "Project2", using a text editor like NotePad. 5-在.sln文件中,使用NotePad等文本编辑器将“Project1”的所有实例编辑为“Project2”。
6- Restart Visual Studio, and everything will work as before, but with the project in a different directory. 6-重新启动Visual Studio,一切都将像以前一样工作,但项目位于不同的目录中。

Alse would recommend TFS, a powerfull tool to do what you pretend. Alse会推荐TFS,这是一个强大的工具来做你假装的事情。 You will be able even to recover previous versions of specific files,if you have any error and you have troubles find it you can see what changes you did since last "check in " etc. There are many options 您甚至可以恢复以前版本的特定文件,如果您有任何错误并且遇到麻烦,您可以看到自上次“登记”后您所做的更改等。有很多选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM