5

In Visual Studio, I usually call my start project as project V 1_0. Going forward with the project, adding parts, i have the necessity to maintain the previous versions and save the newest with different file name, as project v 1_5 or project v 2_0 to have the history and a backup.

Under File, there is the possibility to save the project As something else, but its only the project file (.sln). What about all the folders and relative files?

How can I save all as forward release?

peterh
  • 11,875
  • 18
  • 85
  • 108
Massimo D. N.
  • 316
  • 1
  • 6
  • 17

5 Answers5

9

Very simple:

  1. Open the folder where the solution and the projects are.
  2. Make a copy of the desired project folder.
  3. Rename the *.csproj file in the copied project folder to the new project name.
  4. Open the solution in the Visual Studio, right click on the solution and select Add -> Existing project. Then select the project file you renamed in step 3.

Paths in the project file are relative, so everything should work just fine.

Dávid Molnár
  • 10,673
  • 7
  • 30
  • 55
  • I already tried something similiar but its not correct. When i create a new project, let say VB, so in my Visual Basic folder, Visual Studio create under my Visual Basic folder: project V 1_0 folder. Inside it: project V 1_0 folder, project V 1_0.sln and .vs folder. And then creates all the necessari files and folders inside project V 1_0 folder. Doing what you suggested should work, but all the project folders and files remains on the old name (also the created .exe for example). So its not exactly what i'm looking for – Massimo D. N. May 19 '17 at 07:40
  • 1
    No, I suggest you create a solution, e.g. mysolution. Inside this solution create a project (project V 1_0). Then create a copy of the project folder, rename the vbproj file, the solution remains the same. Then add the new project into the solution (project V 1_1). If you want, you can rename the output file name too (in project properties). – Dávid Molnár May 19 '17 at 07:49
  • I don't understand what you mean with: I suggest you create a solution, e.g. mysolution. Inside this solution create a project (project V 1_0). I have an Italian V.S. 2017 and can do only new project (that really is a solution) and a new project from existing code – Massimo D. N. May 19 '17 at 08:02
  • @MassimoD.N. I think the step are (1) Copy project folder and rename CSPROJ file name (2) Create an empty solution (3) Add renamed project by Solution Explorer -> Add -> Existing Project – Cloud Cho Mar 20 '19 at 21:06
4

I've been looking for the elusive "Save As" workaround for Visual Studio, and ran across this on Microsoft's website: https://msdn.microsoft.com/en-us/library/754c3hy7.aspx

On the menu bar, choose File, New, Project From Existing Code. The Create New Project from Existing Code Files wizard opens.

I'm a total noob - and could very likely be doing something wrong - but it opened up the same project - but with a different name. Any changes to the new file also happened on the original file. Maybe you're supposed to drag/copy the old files into the new project?

Thought I'd post this here because it's from Microsoft so it might be useful in the right hands - and I'd hadn't seen any mention or reference to it in any of the workarounds.

Sandy G
  • 41
  • 1
  • 2
1

Why not use GIT? You create your project, add git to it. And save with the numbering you want. Besides being more organized you will be able to pick up the versions according to what you need. Without having to rename the files.

Maybe this will help: https://www.infragistics.com/community/blogs/dhananjay_kumar/archive/2016/07/21/step-by-step-working-with-github-repository-and-visual-studio-2015.aspx

1
  1. Open the folder where the solution and the projects are.
  2. Make a copy of the desired project folder.
  3. Rename the *.csproj and *.sln file in the copied project folder to the new project name.
  4. Open the *.sln file with a text editor and change the old project name with new one and save it.
  5. Double click *.sln file and open it.

This worked for me. (Visual Studio - version 16)

ouflak
  • 2,458
  • 10
  • 44
  • 49
ysfbil
  • 11
  • 1
0

to save as a back up - introduce an error into the MainWindow.xaml.cs. e,g. type 'ERROR' after the final '}' Press - 'Close Solution'. Because their is an error the 'Save As' option' appears. If their is no error it does not give the 'Save As option', just goes ahead and saves !!

If or when you load the back up, remove the error

What genius at Microsoft decided this !!

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 06 '22 at 14:22