Visual Studio Copy Project

前端 未结 12 750
暗喜
暗喜 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:24

    I guess if this is something you do often, there's a little (non-free) utility that promises to do it for you: I haven't used it, so 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 give the codeplex project a try, and if it doesn't work I'll manually rename everything and edit the sln file.

    0 讨论(0)
  • 2020-12-04 07:26

    Just create a template;

    From your project choose: Project - Export Template

    The wizard will let you define

    • Template name
    • Template Description
    • Icon
    • Preview image

    Then it zips up your project into 'My Exported Templates' directory. You also have the option to make your template available when you create a new project.

    When you use your template to create a new project, the namespace will be correct for 'your_new_project_name' throughout every file, all references correct, everything perfecto :)

    You can send the .zip file to anybody, and they must copy (not unzip) the .zip file into Templates\ProjectTemplates directory for them to use too.

    I made an ASP.NET MVC template with folders, layout page, viewmodels etc arranged just how I like them.

    NOTE:
    If you have an empty folder in your project, it WON'T be added to the template, so I just added an empty class appropriate to each folder, and a sample picture for images folder.

    0 讨论(0)
  • 2020-12-04 07:26

    The easiest way to do this would be to export the project as a template and save it to the default template location. Then, copy the template into the exact same directory on the location you want to move it to. After that, open up visual studio on the new location, create a new project, and you will get a prompt to search for a template. Search for whatever you named the template, select it and you're done!

    0 讨论(0)
  • 2020-12-04 07:28

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

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

    0 讨论(0)
  • 2020-12-04 07:28

    I use Visual Studio 2013 where Project > Export Template is not an option. Here is what I use to clone a project.

    From your solution: File > Export Template > select project to make template from, note save path

    Download and install VS 2013 SDK Here

    Create new VSIX project under Extensibility

    From the VSIXManifest Dialog select the Assets tab

    Fill in the Author textbox

    Choose "Project Template" for Type and Browse to add the exported template (saved at path you noted in step 1)

    Save and build the VSIX project. Go to the VSIX project's .../bin/Debug folder and double click to run the .vsix file

    Start new instance of Visual Studio and you should see your template under whatever project type your template is. Create a new project from your template

    You will have to re-add any dll references

    0 讨论(0)
  • 2020-12-04 07:33

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

    So,

    1. Copy the existing project folder to the destination you want
    2. 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).
    3. Change the name of the solution file (*.sln)
    4. Change the names of the sub-projects if exist.
    5. 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.
    6. The same action with method names.
    7. Check solution's properties if you want to change.

    That's it. You are ready!!!

    0 讨论(0)
提交回复
热议问题