Walkthrough: Adding an existing Visual Studio solution to another solution
Often, developers partition their applications into separate Visual Studio solutions in order to make managing the complexity of the overall application easier. Sometimes, the reverse is true. That is, you may want to combine several existing solutions into one master solution. The reason for doing this may be to make it easier to navigate between the different files in different solutions or perhaps make the build process for the overall application more manageable.
One of the little known facts of Visual Studio is that you can add an existing solution to another solution, without impacting the existing solution. Let's assume for this exercise that you want to add the Engine solution to the Robot solution.
The first step is to create a "Solution Folder" in the the Robot solution. Give the Solution Folder the same name as the the solution that you're adding, in this case "Engine". The reason for crating a Solution Folder is that it acts as a container for all of the projects in the Engine solution. Otherwise, the projects in the Engine solution would be mixed with projects from the Robot solution.
Once you’ve created the "Engine" Solution Folder in the Robot solution, right-click the folder and select the Add –> Existing Project... command. In the Add Existing Project dialog, change the file type to "Solution (*.sln) to see the solution file, i.e. Engine.sln.
Once you’ve added the Engine solution, the Robot solution will now contain the projects from the Engine solution, as shown below. The nice thing about this approach is that not only are all the projects now in one solution but at any time, you can open the separate solutions without impacting the "master" solution and vice versa.
Below is a screenshot of a real world example after eight solutions have been combined into one. The "master" solution contains eight other solutions. You can see that "DinnerNow – Main" contains 31 project, even though these projects are part of other solutions.
Habib Heydarian.
Comments
- Anonymous
June 26, 2009
PingBack from http://www.alvinashcraft.com/2009/06/26/dew-drop-june-26-2009/