Visual Studio Copy Project

前端 未结 12 795
暗喜
暗喜 2020-12-04 07:02

I would like to make a copy of my project. I would rather not start doing it from scratch by adding files and references, etc. Please note that I don\'t mean copy for deploy

12条回答
  •  被撕碎了的回忆
    2020-12-04 07:34

    It is highly NOT ADVISABLE to copy projects at all because the some config files formed internally like .csproj, .vspscc etc. may (and most probably will) point to references which belong to previous solutions' location and other paths/locations in system or TFS. Unless you are an expert at reading these files and fixing references, do not try to copy projects.

    You can create a skeletal project of the same type you intend to copy, this creates a proper .csproj, .vspscc files. Now you are free to copy the class files,scripts and other content from the previous project as they will not impact. This will ensure a smooth build and version control (should you choose to be interested in that)

    Having said all this, let me give you the method to copy project anyhow in a step-wise manner:

    1. Go to the project you want to copy in solution explorer and right-click.
    2. Now select 'Open Folder in File Explorer' (Assuming you have the solution mapped to a local path on your disk).
    3. Select the Projects you want to replicate as whole folders(along with all dependencies,bin .vspscc file, .csproj file)
    4. 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).
    5. No go back to Visual Studio, Right-Click on Solution > Add > Existing Project...
    6. Browse and select the Project file (.csproj file) now from the location you placed it in and select 'open'
    7. This file now appears in the solution explorer for you to work.

    You may now have to resolve a few build errors probably with duplicated/missing references and stuff but otherwise it's as pristine in logic and structure as you expected it to be.

提交回复
热议问题