Creating a new solution/project by copying an existing one.

I am a newby to this environment.  I have spent considerable time creating a Windows Form with a C# program.  I want to create a new application using this Form with some alteration and much of the current program code.  By the way, I do NOT want to destory my current application or solution.  I would prefer to have a new Solution/Project in a new directory.  How do I go about it

Thanks in advance for your help.

Perry G.



Answer this question

Creating a new solution/project by copying an existing one.

  • ntman

    Is this VS 2005   In the File menu, you can use Export Template to save the project as a template and then use it as a pattern for a new project.

  • jsvonline.com

    You should look in the documentation for VS.  In there is a topic about extending VS.  You'll want to look at the topic for creating new items and projects.  It effectively boils down to creating the appropriately formatted file that VS can understand.  By placing this file and a copy of your project in the right directory VS will present it as an option when creating new projects. If the user selects your custom project then the project will be created for them.  I know in VSTE there is an option to export a project template from the currently opened project.  This may be one way of doing it but I've never tried it. 

    Unfortunately creating a new project type requires a little work so you should refer to the documentation for the details.  However once you have the base project (from your existing project) it simply becomes a matter of replacing your project-specific names and types with generic templates that can be populated by the wizard.  If you need to prompt the user for information then you'll need to create a full-up wizard.  This is also contained in the documentation.

    Here is the link: http://msdn2.microsoft.com/s365byhx.aspx

    Michael Taylor - 11/23/05

  • foxteeth

    I have just completed an article for Coding4Fun that goes through creating an application template, the article uses a base directX application as an example but the procedures are the same no matter what application you are working on.

  • milocr

    Thank you for your reply.  Yes this VS 2005.  I will try this.

    Perry G.

  • Creating a new solution/project by copying an existing one.