Visual Studio Copy Project

I would like to make a copy of my project. I would prefer not to start doing it from scratch by adding files and links, etc. Please note that I do not mean a copy for deployment. Just an ordinary copy.

Is there a tool in VS for this? I am using VS 2008

+105
visual-studio-2008 visual-studio
May 19 '09 at 18:10
source share
9 answers

If you need a copy, the quickest way to do this is to save the project. Then make a copy of the entire file in the File System. Return to Visual Studio and open the copy. From there, I most likely recommend renaming the project / solution so that you don't have two identical names, but this is the fastest way to make a copy.

+121
May 19 '09 at 18:13
source share

Just create a template;

Selected from your project: Project - Export Template

The wizard will let you determine

  • Template Name
  • Template Description
  • Icon
  • Image Preview

He will then archive your project into the My Exported Templates directory. You also have the opportunity to make your template available when creating a new project.

When you use your template to create a new project, the namespace will be correct for 'your_new_project_name' in all files, all links are correct, everything is perfect! :)

You can send the .zip file to anyone, and they must copy (not unzip) the .zip file to the Templates \ ProjectTemplates directory so that they can use it too.

I made an ASP.NET MVC template with folders, page layout, view models, etc., arranged the way I like them.

NOTE:
If you have an empty folder in your project, it will NOT be added to the template, so I just added an empty class corresponding to each folder and a sample image for the image folder.

+51
Mar 06 '17 at 3:53 on
source share

I think if this is what you often do, there is a small (non-free) utility that promises will do it for you: I have not used it, so I'm not sure how good it is:

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

There is also this project on CodePlex:

http://clone.codeplex.com/

I will probably try the codeplex project, and if it does not work, I will manually rename everything and edit the sln file.

+6
Jan 15 '12 at 19:17
source share

I follow these steps and I use the Resharper development tool , which is awesome by the way:

So,

  • Copy the existing project folder to the desired destination
  • Go to the source control and right-click only the root folder and select "Add items to folder ..." . Then a wizard will appear to select the files to copy (some files are not necessary, and for this reason the wizard is the default by default).
  • Change the solution file name (* .sln)
  • Change the names of subprojects, if they exist.
  • Use Resharper to change the namespaces binding name (I will automatically do the dirty job with security). An alternative way is to change all namespaces with a new name.
  • Same action with method names.
  • Check the solution properties if you want to change.

What is it. You are ready!!!

+3
Sep 24 '14 at 11:17
source share

It’s strongly NOT possible to copy projects at all, because some configuration files created internally, such as .csproj, .vspscc, etc., can (and most likely will) point to links belonging to previous solutions' location and other paths / system locations or TFS. If you are not a specialist in reading these files and correcting links, do not try to copy projects.

You can create a skeleton project of the same type that you are going to copy, which creates the correct .csproj, .vspscc files. Now you can copy class files, scripts and other content from the previous project, since they will not affect. This will ensure smooth version and version control (if you decide to be interested in this)

Having said all this, let me give you a method of copying a project one way or another in stages:

  • Go to the project you want to copy in the solution explorer, and right-click.
  • Now select " Open Folder in File Explorer " (suppose the solution was displayed locally on your disk).
  • Select the projects that you want to replicate as entire folders (along with all the dependencies, the file bin.vspscc, .csproj).
  • Paste them in the right place (it can be your solution folder or even another solution folder. If it is in the same solution folder, you will need to rename it, as well as .csproj and other internal files with a new name).
  • Do not return to Visual Studio, Right-click on the solution> Add> Existing project ...
  • Locate and select the project file (.csproj file) now from the location where you placed it, and select " open "
  • This file is now displayed in the solution explorer for work.

Now you may need to resolve a few build errors, possibly with duplicate / missing links and other information, but otherwise it will be a devaluation in the logic and structure, as you expected.

+3
Jan 11 '17 at 5:24 on
source share

The best way is to create a new project from scratch, then go to the folder with the project files that you want to copy (project, form1, everything except folders). Rename the files (except for the form1 files), for example: I copied the Ch4Ex1 files to my Ch4Ex2 project, but first renamed the files to Ch4Ex2. Copy and paste these files into Solution Explorer for a new project in Visual Studio. Then just overwrite the files and you have to be good to go!

Old thread, but I hope this helps anyone looking for this answer!

+1
Sep 30 '12 at 23:29
source share

I have a project in which the source files are in a folder under the project folder. When I copied the project folder without the source folder and opened the copied project, the source files will not be missing, but will be found in the same place. I closed the project, also copied the source folder and reopened the project. Now the project magically refers to the copied source files (as the new path appeared on β€œsave as”, and the file change was saved in the copied version).

There is a caveat: if both the old and new project folders are not under the library used, the above magic also removes the absolute link to the library and expects it with the same relative path.

I tried this with VS Express 2012.

0
Oct 26 '16 at 11:50
source share

My solution is a little different - the computer on which the package was located died, so I was forced to recreate it on another computer.

What I did (in VS 2008) was to open the following files in my directory:

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

When I did this, a pop-up window asked me if the sln file would be a new solution, and when I click yes, everything works fine.

0
May 24 '17 at 21:25
source share

After completing the above solutions and creating a copy for MVC projects

For MVC projects, update the port numbers in the .csproj file, you can use iis applicationhost.config to check the port numbers. The same port numbers will cause build failure in IIS.

0
Oct. 25 '17 at 19:29
source share



All Articles