我想复制一份我的项目。我宁愿不从头开始添加文件和引用等。请注意,我指的不是用于部署的复制。只是简单的复制。

VS中有这样的工具吗?我使用的是vs2008


当前回答

我想如果这是你经常做的事情,有一个小的(非免费的)实用程序可以保证为你做这件事:我没有使用过它,所以不确定它有多好:

http://www.kinook.com/CopyWiz/

CodePlex上还有一个项目:

http://clone.codeplex.com/

我可能会尝试codeplex项目,如果它不起作用,我将手动重命名所有内容并编辑sln文件。

其他回答

我有一个项目,源文件在项目文件夹下面的文件夹中。当我复制没有源文件夹的项目文件夹并打开复制的项目时,源文件并没有丢失,而是在旧位置找到。我关闭项目,复制源文件夹,并重新打开项目。现在,项目神奇地引用了复制的源文件(新路径显示在“另存为”上,文件中的更改已保存在复制的版本中)。

这里有一个警告:如果旧项目文件夹和新项目文件夹都在一个使用过的库文件夹下面,上述魔术也会丢弃对库的绝对引用,并期望它位于相同的相对路径下。

我尝试用VS Express 2012。

我想如果这是你经常做的事情,有一个小的(非免费的)实用程序可以保证为你做这件事:我没有使用过它,所以不确定它有多好:

http://www.kinook.com/CopyWiz/

CodePlex上还有一个项目:

http://clone.codeplex.com/

我可能会尝试codeplex项目,如果它不起作用,我将手动重命名所有内容并编辑sln文件。

如果你想要一个副本,最快的方法就是保存项目。然后在文件系统中复制整个文件。回到Visual Studio并打开副本(通过右键单击solution => add existing project =>打开复制的项目)。从那里,我很可能会建议重新命名项目/解决方案(安全重命名项目的步骤在下面的链接中),这样你就不会有两个相同的名称,但这是复制的最快方法。

我遵循这些步骤,并使用名为Resharper的开发工具,顺便说一句,它非常棒:

So,

Copy the existing project folder to the destination you want Go to source control and with right click just to the root folder you want and pick "Add items to folder...".Then, a wizard will come up to choose the files to copy (there is no need for some files and the wizard guides you for that reason by default). Change the name of the solution file (*.sln) Change the names of the sub-projects if exist. Use Resharper to change the binding namespaces name (I will automatic do the dirty job with safety).The alternative way is to manually change all namespaces with the new name. The same action with method names. Check solution's properties if you want to change.

就是这样。你准备好了!!

我的解决方案有点不同——包所在的计算机死了,所以我被迫在另一台计算机上重新创建它。

我所做的(在VS 2008中)是在我的目录中打开以下文件:

                  - <package name>.djproj
                  - <package name>.dtproj.user
                  - <package name>.dtxs
                  - <package name>.sln
                  - Package.dtsx

当我这样做的时候,一个弹出窗口问我是否sln文件将是一个新的解决方案,当我点击“是”一切工作完美。