Proper steps 'save as' vb2013 solution with another solution name

Please advice on the recommended or proper steps to 'save as' vb2013 solution with a new name.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jacques Bourgeois (James Burger)PresidentCommented:
I have not worked with VB2013, but in all the previous versions, the way to do this is to first click on the Solution in the Solution Explorer, and you will get the Save As in the File menu.

If you cannot do it in 2013, then it is probably because the thing is still in beta and is not complete.
rayluvsAuthor Commented:
(we meant vb2012)

We assume your meant right-click, because just clicking doesn't do anything.

Here is an image of right-click:

Create a copy of the solution folder and then follow these steps

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

rayluvsAuthor Commented:
Ok just read it.  So basically is
- create a copy
- open the copy
- rename solution
(In the link has rename solution, project and item)

Should the rename only be on solution.
(We're not in a PC)

Please comment.
That depends on your needs whether you need to just rename solution or project as well. I cannot dictate that.
rayluvsAuthor Commented:
Our need is to save a current solution with another name and another location.

The same exact procedure when we want to save a document for another name.  For example word, if we want to save a document named X as XB but with another location, we can do it as many time as we want.  we can save a word or excel document as many time as we want.

We want or do this in vb 2012.

By what has been said here, is not as simple as word or excel where one just "file >> save as".

This being said, how can we take a solution and save an exact copy but with a different name and another location; also when we open it, we can start working ip with it.

Hope we explained what we want.

Thanx in advance.
Then the steps would be

1) Copy the solution folder and paste in the target location
2) Open solution in VS and right click on it in solution explorer then select Rename.
rayluvsAuthor Commented:
That's it?

What about the forms and all related to solution?
Jacques Bourgeois (James Burger)PresidentCommented:
Sorry, I have been out of touch for a couple of days.

My answer was OK, I meant a Click, because I was then telling you to go "in the File menu", not in the context menu as you show in your illustration. And it was incomplete because you were talking only about the Save As, not the renaming. Please, try to be precise and complete when you ask a question, you will get your answer faster.

And just to set things straight, the illustration shows that this is not a solution, this is a project.

A solution contains many projects (application, with one or many dlls, with deployment setting, with help system, ect.) and there is only one project there, not a solution.

The Solution Explorer is a little misnamed because it can show a single project even if it is not part of a solution, which is the case according to the illustration.

This difference is minor in the Solution Explorer, but a solution and a project are not the same thing. It's important that you know the difference, because this can be important when you ask a question or when you try to understand the documentation.

CodeCruiser answer will work because replacing "solution" by "project" happened to work in this particular case. But it would have been different if you really had a solution instead of a project, because in such a case, copying and renaming as often not enough.
Jacques Bourgeois (James Burger)PresidentCommented:
"all related" is quite large and might mean many things for many people.

You can rename any of the code files, as long as you do it with a right click inside of the Solution Explorer (do not do it in Windows Explorer).

As for the name of the forms as used in the code, open the code window for the form, right click on the name of the form in the Class line at the beginning of the form, and activate Rename.
rayluvsAuthor Commented:
I am being precise from the beginning: we want to open a solution and save the entire solution with another name an another folder.  We are not looking to rename a solution.

This being said and all being written in this thread, can we conclude that Visual Basic 2012 does not have a  "save as" (like Word and Excel) in order to save en entire solution with another name and to another folder.

Can somebody tell me if this is a correct assumption?
Jacques Bourgeois (James Burger)PresidentCommented:
There is a Save As, but as I said in my first post, you first need to LEFT-click on the project (or the solution) in the Solution Explorer, and then  Save name.sln As  or  Save name.vproj As  (depending on whether you are in a solution or a project) will appear in the FILE menu (upper left corner of the screen).

But the same as in Word and Excel, this does not save a directory, it saves only the one file that defines the solution or the project, not all the other files.

This is why CodeCruiser told you that you need to copy the folder first, and then rename the solution with a right click, which does something similar to a Save As because it renames the .sln or .vbproj file underneath.

The fact that you do not have a Save As that can copy all the files as well as the solution is not an overlook by Microsoft. It makes a lot of sense when you think that Visual Studio was created first for professional developers, whose needs can be varied, and when you understand what a solution is.

You have to understand that a solution or a project is just a list of files with a few extra properties saved along them. Open the .vproj or .sln files that you have in your source code directory and you will see what a solution or a project is. It's a list, nothing more. They are similar. It's just that a solution (.sln) is a list of projects with a few files, while a project (.vbproj) is just a list of files. I will stick with project for now on for simplicity and because that is what I think you have from your screenshot. The discussion applies to both.

By default, all the files for a project are in the same directory and its subdirectories, so some consider the directory to be the solution or project. But this is not the case. When developing some types of applications, or complex applications, or when a big team is working on an application, the source code files for the application can reside in many different directories and even different computers.

A project is just a file that lists the files required for the development of the application. When you open that .vbproj file, it presents your all the necessary files in only one place, the Solution Explorer, no matter where they are located physically on your hard drive or in the universe.

As an example, one of the applications that I am working with now has code coming from my main station, a portable and a tablet. I need the main station because this is where my SQL database and the service that access it are located. The portable because it is a Windows 8 application and only my portable has Windows 8 installed. The tablet because this is where the application will run and I thus need to test it with the tablet.

When I open my solution on the portable, the Solution Explorer shows me files from the 3 different computers in only one place. I do not have to take care about where a file is in order to work with it. And I do not have to go back and forth between 3 monitors and/or 3 instances of Visual Studio if I have to work with the 3 parts of the application at the same time, I have everything in one copy of Visual Studio and on the same screen.

You understand that since a Solution can be built that way, a simple Save As is absolutely useless. If you want to move or copy a project's file, you do it manually, open it in its new location, and if needed, you rename things with right clicks in the Solution Explorer.

Not as easy as Save As, but power tools that can do more than simple tools sometimes require a little more elbow grease. If I want to saw a plank with my hand saw, I take the saw and saw. If I want to saw a plank with my table saw, I might need to first change the blade, then adjust the blade height, then adjust the fence and then saw. It ends up being beneficial in the long run, but it can take me 5 minutes to set up while there is no set up at all with the hand saw.

Visual Studio is a very powerful tool.
rayluvsAuthor Commented:
Wow! Great info!  Listen, just to make sure you understand our need, is Solution we want to save in another location and in another folder no Project (we're saying this because in your entry you say you will stick to project for now since that is our screenshot); the screenshot was only for the sole purpose of showing there is a "save as" and that when we click on recent, there is no *.sln display.  So if there is any info missing in your entry becuase you directed to just Project, please comment on missing parts related to Solution.

Thank your very much!
Jacques Bourgeois (James Burger)PresidentCommented:
Because solutions might be built in different ways, there might be issues that you do not find in a project. Most of the time, copying and renaming is sufficient. But not always. It depends on what kind of projects you have in the solution, where they are located, what dlls they reference, where the copy is made.

I won't be able to cover all the possible scenarios here, there are too many, but I will talk about the 2 most commons. Looking at the beginning of a solution file tells you a lot:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "JBWoodwork", "JBWoodwork.vbproj", "{857D7041-BAAE-4BB8-9361-A9CF10B43881}"
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "JBLib", "..\JBLib\JBLib.vbproj", "{53924F5B-40F6-493B-8556-DDAF7AE75EA4}"
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "JBWoodworkLib", "JBWoodworkLib\JBWoodworkLib.vbproj", "{F569C3D7-BC5E-4482-9CBD-1409AB04BCB8}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F1B0B69D-49FB-4E23-992C-AB79725B8281}"
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "JBCalc", "..\JBCalc\JBCalc.vbproj", "{B2B45B39-6F46-4D02-BD9E-874B32146AD2}"
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "JBWoodworkTest", "JBWoodworkTest\JBWoodworkTest.vbproj", "{B2FA567C-25B6-4DD0-A89A-3032B6E4961C}"
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "JBWoodworkWCF", "JBWoodworkSvc\JBWoodworkWCF.vbproj", "{15B3E0D2-6217-493A-A690-158C497F5318}"

Open in new window

This lists all the projects in the solution, with the directory/file that defines them.

As you can see, the directories are specified to a path that is relative to the .sln file.

When you do not have a directory, the project is in the same directory as the solution. If you have a path without the .., then the project is in a directory that is under the .sln directory.

In the first scenario, if all of your projects are located under the solution directory, then copying the solution directory and its subdirectories somewhere else and renaming the solution is wanted will be sufficient.

The second scenario deals with a solution that would have those directories that begins with .., implying a relative path. These are located somewhere else, so they won't be copied along with the solution. Depending on where you make the copy, the relative paths might not work anymore. When you open the copied solution, you will then end up with projects that cannot be found. In such a case, you can either modify the .sln file manually to recreate proper paths, or work in the Solution Explorer to remove the projects whose link is broken, and add them anew to the solution through the FILE menu.

There might be dozens of other problems however. For instance, if you copy the solution to another computer, some of the dlls referenced might missing or be of the wrong version number. Or if you use stuff that is outside of the computer, such as servers or databases, the new computer might not have the same rights as the original one. These problems must be solved individually as they appear.
rayluvsAuthor Commented:
Read entries and tried various ways based on the thread.  The only way it seems to work is the following:

1. Copy the entire folder solution to the desired folder.
2. Go to the new folder
3. Delete *.suo
4. Rename the Solution sub'Folder to the desired name
5. Edit *.sln and correct the folder line
    Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "xxxx", "YYY\xxxx.vbproj"...
2. Open the Solution at the copied folder.
3. In the Solution Explorer, Right-Click and Rename to the new Solution Name.
4. Exit VS


Please advice if missing instruction or a better way.

Thanx all!
rayluvsAuthor Commented:
will proceed to close the question.
rayluvsAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.