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

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


当前回答

欺骗克隆从存储库工具

在文件资源管理器中打开项目位置。 复制路径到任何浏览器(也就是在浏览器中打开项目位置)。 使用来自浏览器的地址作为克隆的源存储库。 放松和享受无错误克隆。

其他回答

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

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

CodePlex上还有一个项目:

http://clone.codeplex.com/

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

按照Shane上面的回答(顺便说一句,这很有效)……

您可能会在参考列表中遇到大量黄色三角形。 大多数这些可以消除Build->清洁解决方案和Build->重建解决方案。

我确实碰巧有一些谷歌API的参考,有点固执…以及NewtonSoft JSon。

试图重新安装相同版本的NuGet包失败。 Visual Studio认为您已经安装了它。

要解决这个问题: 1:写下原始版本。 2:安装下一个更高/更低的版本…然后卸载。 3:安装步骤1中的原始版本。

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

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

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

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

我遵循这些步骤,并使用名为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.

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

完全不建议复制项目,因为一些内部形成的配置文件,如.csproj, .vspscc等可能(而且很可能)指向属于以前解决方案的位置和系统或TFS中的其他路径/位置的引用。除非你是阅读这些文件和修复引用的专家,否则不要试图复制项目。

您可以创建一个与您打算复制的相同类型的框架项目,这将创建一个适当的.csproj, .vspscc文件。现在你可以自由地复制类文件,脚本和其他内容从以前的项目,因为他们不会影响。这将确保平稳的构建和版本控制(如果您对此感兴趣的话)。

说了这么多,让我给你一个循序渐进复制项目的方法:

Go to the project you want to copy in solution explorer and right-click. Now select 'Open Folder in File Explorer' (Assuming you have the solution mapped to a local path on your disk). Select the Projects you want to replicate as whole folders(along with all dependencies,bin .vspscc file, .csproj file) Paste them in your desired location (it could be your same solution folder or even another solution folder. If it is within the same solution folder, then you would be required to rename it, also the .csproj and other internal files to the new name). No go back to Visual Studio, Right-Click on Solution > Add > Existing Project... Browse and select the Project file (.csproj file) now from the location you placed it in and select 'open' This file now appears in the solution explorer for you to work.

你现在可能不得不解决一些构建错误,可能是重复/缺失的引用和东西,但否则它是原始的逻辑和结构,因为你期望它是。