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

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


当前回答

在尝试以上解决方案&创建副本MVC项目

对于MVC项目,请更新。csproj文件中的端口号,您可以借助iis applicationhost。配置检查端口号。相同的端口号将导致IIS中程序集加载问题。

其他回答

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

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

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

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

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

CodePlex上还有一个项目:

http://clone.codeplex.com/

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

欺骗克隆从存储库工具

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