How do I move an existing project (the project's own files, other files which the project depends on, settings (including Additional Include Directories) and all) from one solution to
I am using Visual Studio Community 2015.
I do not want to hack .sln files; I want VS to do it properly. .sln files contain IDs which I don't understand.
Each project should retain its present project-name.
I have several projects I would like to move, each of which has dependencies which are not part of the project itself, so an easy method would be nice.
I see Visual Studio move project to a different folder but it doesn't answer my question.
No item in the Project menu is relevant (that's where I'd have thought the relevant item would be, if there were one), or any other toolbar menu, or the menu that pops up when I click mouse button 2 on the project's entry in the Solution Explorer...
To add an existing project to a solutionIn Solution Explorer, select the solution. On the File menu, point to Add, and click Existing Project. In the Add Existing Project dialog box, locate the project you want to add, select the project file, and then click Open. The project is added to the selected solution.
In Visual Studio, click Tools > Options. Expand Projects and Solutions and click Locations. The Projects location field defines the default location for storing new projects. You can change this path if you are using a different working folder.
A project is contained within a solution. Despite its name, a solution isn't an "answer". It's simply a container for one or more related projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with a particular project.
Here's how I now do it --- thanks to a comment by HansPassant.
If the new solution doesn't yet exist, create it as follows:
I think of a project as being part of a solution (rather than projects being separate from solutions). Therefore, in my solutions, a project's directory is a subdirectory of that for the solution which contains the project.
How come I didn't see this before? Two things. One was that I expected the function to be on a pop-up made by clicking mouse button 2 on the Solution Explorer entry for the project. The other was I had never before created a solution as such --- only ever created a project, choosing an existing solution or "Create new solution" as the case may be. Not good UI, IMO, to hid the "create solution" functionality under "New Project". Once the new solution exists, Hans's method makes the rest of the task easy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With