Understanding Solutions
In Visual Studio .NET, a solution is a thin wrapper that contains a project or a number of projects. Every project in Visual Studio .NET is part of a solution by default, and even if you open a lone project file for editing, you'll be prompted to save a new solution file for the project at some point in your editing session. The solution concept is important because much of what you can do in Visual Studio .NET revolves around accessing functionality that's exposed in different projects.
Solution Items and Miscellaneous Files
Solutions can contain solution items and miscellaneous files in addition to projects. Solution items can consist of HTML files, bitmaps, icons, XML files, templates, and schemas, among others. Miscellaneous files can be a bit of a mystery. First of all, you need to make the Miscellaneous Files folder visible in Solution Explorer to take advantage of these kinds of files. To see this folder, you select the Show Miscellaneous Files In Solution Explorer check box on the Documents page in the Environment folder of the Options dialog box, as shown in Figure 2-2. Keep in mind that you won't see the Miscellaneous Files folder until you open a nonproject item in the IDE using File.OpenFile.
Figure 2-2. You can enable the Miscellaneous Files folder in the Options dialog box.

Miscellaneous files are files that you might open in the IDE for reference purposesfor example, if you want to review some code in a listing that you don't want to make part of your project. Opening such a file in the IDE without importing it into your solution automatically places the file into the Miscellaneous Files folder. The linked file is aggregated into the Miscellaneous Files folder in a solution.Keep in mind that any file you open from Visual Studio .NET gets a link in the Miscellaneous Files folder. This folder persists your items between sessions if you set Miscellaneous Files Project Saves Last to something like five items. This means you can open specifications, schedules, and notes and have those files at your fingertips every time you open your project, as shown in Figure 2-3.
Figure 2-3. You can use the Miscellaneous Files folder to store links to documents relating to your projects.

Solution Properties
The Solution Property Pages dialog box gives you easy access to the settings that apply to an entire solution. Among the options that you can control include the startup project or projects for your solution, the locations for files and symbols used for debugging, and the configuration settings that apply to the different projects in your solution.You can get to the Solution Property Pages dialog box by making sure that the solution name is selected in Solution Explorer, pressing Ctrl+Alt+A, and entering Project.Properties in the Command Window, or by right-clicking on the project and then choosing Properties. Most of the major programming projects in Visual Studio .NET present you with the Property Pages dialog box shown in Figure 2-4.
Figure 2-4. The Solution Property Pages dialog box gives you access to solution settings.

Common Properties
Clicking the Common Properties folder in the folder pane on the left exposes a number of options. The first option is Startup Project. In multiple-project solutions, you can select which project launches when the solution is run from the Debug menu. You'll most often set this option on the fly by right-clicking on a project name in Solution Explorer and then choosing Set As StartUp Project from the project shortcut menu.If you want to run more than one solution when you choose Start or Start Without Debugging from the Debug menu, you can select the Multiple Startup Projects option. Selecting this option lets you select the behavior of each of the projects in your solution when you invoke Debug.Start or Debug.StartWithoutDebugging. You can select Start, Start Without Debugging, or None. The Move Up and Move Down buttons to the right of the list of projects lets you set the order in which the programs are started.In a number of scenarios, running multiple projects concurrently might be useful. You might want to test some interprocess communication features between various assemblies in your solution. You might use a second project to do some profiling or instrumentation. Another use might be to run a utility that takes control of another assembly for automated testing purposes.The second option in the Common Properties folder is Project Dependencies. When some assemblies in a solution depend on others in the same solution, the build order for the different projects in the solution is critical. The Project Dependencies settings let you specify which projects need to be built before others in order to get the entire solution up and running.The last two options in the Common Properties folder let you set file paths for source files and debug symbols that might come up in your application. These settings allow you to step into the source code for libraries that are referenced by your projects but that aren't part of your project. If you're debugging a project that's referencing a debug version of a .NET assembly, Visual Studio .NET is usually able to find the source for the assembly if it's available. If the source is stored in a different location, you can specify the location of the source files and the debug symbols so that you can debug into that source.
Configuration Properties
Solutions can have multiple configurations that give you quick access to preset options relating to your solution. The Debug and Release configurations are available to new projects by default, but you can create your own configurations using the Configuration Manager, which is accessible from the Solution Property Pages dialog box or from the Build menu (Build.ConfigurationManager).Visual Studio .NET offers two types of configurations: solution configurations and project configurations. Solution configurations are for configuring different build setups within a particular solution. For example, you can create and save a specific solution that allows you to select a different configuration for each project in your solution.The second type of configuration is the project configuration. We'll discuss custom project configurations in detail later in the chapter, but for now consider how different projects might relate to one another in a solution. Project configurations let you change some very specific build characteristics. These characteristics include code optimizations, debugging switches, and even the location of the project's compiled files. If you have five projects with different custom settings in a single solution, you should use custom solution configurations to save and manage the different build scenarios that might come up.
Solution and Solution User Options Files
The solution source .sln file is a plain-text document that describes the solution. The solution file contains links to the projects contained in the solution. It also contains version information about the format of the solution file itself. Solution files created with Visual Studio .NET 2002 carry the signature Microsoft Visual Studio Solution File, Format Version 7.00. Solution files created with or converted to Visual Studio .NET 2003 read Microsoft Visual Studio Solution File, Format Version 8.00.ImportantOnce you convert a file to Visual Studio .NET 2003, you can no longer open it in Visual Studio .NET 2002.The .sln file also contains information on the various configurations that have been set up in the solution. Information about the different solution configurations is stored in this file, along with information about how the different project configurations are organized in those solution configurations. Listing 2-1 was used to organize a number of different project types for this chapter.
Listing 2-1 An example solution file
Chapter02.sln
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VBWinApp",
"VBWinApp\VBWinApp.vbproj",
"{D7AFF922-38D5-461C-A07B-859080BFCFBF}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VBWebApp",
"http://localhost/VBWebApp/VBWebApp.vbproj",
"{D654F4FC-7144-457A-9D73-A149ECD0DB40}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSWinApp",
"CSWinApp\CSWinApp.csproj",
"{9D585FB1-AA56-4227-AB14-23F16E4F07E4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSWebApp",
"http://localhost/CSWebApp/CSWebApp.csproj",
"{AB66D7EB-DB6F-45E8-AE7D-B972D2A652F1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CPPWin32",
"CPPWin32\CPPWin32.vcproj",
"{912ECF9E-5ABA-4E85-8955-2B0DC464C377}"
EndProject
Project("{E6FDF86B-F3D1-11D4-8576-0002A516ECE8}") = "VJConsoleApp",
"VJConsoleApp\VJConsoleApp.vjsproj",
"{2022B3FD-6AFB-4912-8687-4B09257A48A1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSWebService",
"http://localhost/CSWebService/CSWebService.csproj",
"{22A37BFE-687D-44E6-9C0C-711735BC5018}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug
ConfigName.1 = Debug1
ConfigName.2 = PostCMD
ConfigName.3 = PostExplorer
ConfigName.4 = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{D7AFF922-38D5-461C-A07B-859080BFCFBF}.Debug.ActiveCfg = Debug|.NET
{D7AFF922-38D5-461C-A07B-859080BFCFBF}.Debug.Build.0 = Debug|.NET
{D7AFF922-38D5-461C-A07B-859080BFCFBF}.Debug1.ActiveCfg = Debug|.NET
{D7AFF922-38D5-461C-A07B-859080BFCFBF}.Debug1.Build.0 = Debug|.NET
{D7AFF922-38D5-461C-A07B-859080BFCFBF}.PostCMD.ActiveCfg = Release|.NET
{D7AFF922-38D5-461C-A07B-859080BFCFBF}.PostCMD.Build.0 = Release|.NET
{D7AFF922-38D5-461C-A07B-859080BFCFBF}.PostExplorer.ActiveCfg =
Release|.NET
{D7AFF922-38D5-461C-A07B-859080BFCFBF}.PostExplorer.Build.0 =
Release|.NET
{D7AFF922-38D5-461C-A07B-859080BFCFBF}.Release.ActiveCfg = Release|.NET
{D7AFF922-38D5-461C-A07B-859080BFCFBF}.Release.Build.0 = Release|.NET
{D654F4FC-7144-457A-9D73-A149ECD0DB40}.Debug.ActiveCfg = Debug|.NET
{D654F4FC-7144-457A-9D73-A149ECD0DB40}.Debug.Build.0 = Debug|.NET
{D654F4FC-7144-457A-9D73-A149ECD0DB40}.Debug1.ActiveCfg = Debug|.NET
{D654F4FC-7144-457A-9D73-A149ECD0DB40}.Debug1.Build.0 = Debug|.NET
{D654F4FC-7144-457A-9D73-A149ECD0DB40}.PostCMD.ActiveCfg = Release|.NET
{D654F4FC-7144-457A-9D73-A149ECD0DB40}.PostCMD.Build.0 = Release|.NET
{D654F4FC-7144-457A-9D73-A149ECD0DB40}.PostExplorer.ActiveCfg =
Release|.NET
{D654F4FC-7144-457A-9D73-A149ECD0DB40}.PostExplorer.Build.0 =
Release|.NET
{D654F4FC-7144-457A-9D73-A149ECD0DB40}.Release.ActiveCfg = Release|.NET
{D654F4FC-7144-457A-9D73-A149ECD0DB40}.Release.Build.0 = Release|.NET
{9D585FB1-AA56-4227-AB14-23F16E4F07E4}.Debug.ActiveCfg = Debug|.NET
{9D585FB1-AA56-4227-AB14-23F16E4F07E4}.Debug.Build.0 = Debug|.NET
{9D585FB1-AA56-4227-AB14-23F16E4F07E4}.Debug1.ActiveCfg = Debug1|.NET
{9D585FB1-AA56-4227-AB14-23F16E4F07E4}.Debug1.Build.0 = Debug1|.NET
{9D585FB1-AA56-4227-AB14-23F16E4F07E4}.PostCMD.ActiveCfg = Debug1|.NET
{9D585FB1-AA56-4227-AB14-23F16E4F07E4}.PostCMD.Build.0 = Debug1|.NET
{9D585FB1-AA56-4227-AB14-23F16E4F07E4}.PostExplorer.ActiveCfg =
Debug1|.NET
{9D585FB1-AA56-4227-AB14-23F16E4F07E4}.PostExplorer.Build.0 =
Debug1|.NET
{9D585FB1-AA56-4227-AB14-23F16E4F07E4}.Release.ActiveCfg = Release|.NET
{9D585FB1-AA56-4227-AB14-23F16E4F07E4}.Release.Build.0 = Release|.NET
{AB66D7EB-DB6F-45E8-AE7D-B972D2A652F1}.Debug.ActiveCfg = Debug|.NET
{AB66D7EB-DB6F-45E8-AE7D-B972D2A652F1}.Debug.Build.0 = Debug|.NET
{AB66D7EB-DB6F-45E8-AE7D-B972D2A652F1}.Debug1.ActiveCfg = Debug|.NET
{AB66D7EB-DB6F-45E8-AE7D-B972D2A652F1}.Debug1.Build.0 = Debug|.NET
{AB66D7EB-DB6F-45E8-AE7D-B972D2A652F1}.PostCMD.ActiveCfg = Release|.NET
{AB66D7EB-DB6F-45E8-AE7D-B972D2A652F1}.PostCMD.Build.0 = Release|.NET
{AB66D7EB-DB6F-45E8-AE7D-B972D2A652F1}.PostExplorer.ActiveCfg =
Release|.NET
{AB66D7EB-DB6F-45E8-AE7D-B972D2A652F1}.PostExplorer.Build.0 =
Release|.NET
{AB66D7EB-DB6F-45E8-AE7D-B972D2A652F1}.Release.ActiveCfg = Release|.NET
{AB66D7EB-DB6F-45E8-AE7D-B972D2A652F1}.Release.Build.0 = Release|.NET
{912ECF9E-5ABA-4E85-8955-2B0DC464C377}.Debug.ActiveCfg = Debug|Win32
{912ECF9E-5ABA-4E85-8955-2B0DC464C377}.Debug.Build.0 = Debug|Win32
{912ECF9E-5ABA-4E85-8955-2B0DC464C377}.Debug1.ActiveCfg = Debug|Win32
{912ECF9E-5ABA-4E85-8955-2B0DC464C377}.Debug1.Build.0 = Debug|Win32
{912ECF9E-5ABA-4E85-8955-2B0DC464C377}.PostCMD.ActiveCfg =
PostCMD|Win32
{912ECF9E-5ABA-4E85-8955-2B0DC464C377}.PostCMD.Build.0 = PostCMD|Win32
{912ECF9E-5ABA-4E85-8955-2B0DC464C377}.PostExplorer.ActiveCfg =
PostExplorer|Win32
{912ECF9E-5ABA-4E85-8955-2B0DC464C377}.PostExplorer.Build.0 =
PostExplorer|Win32
{912ECF9E-5ABA-4E85-8955-2B0DC464C377}.Release.ActiveCfg =
Release|Win32
{912ECF9E-5ABA-4E85-8955-2B0DC464C377}.Release.Build.0 = Release|Win32
{2022B3FD-6AFB-4912-8687-4B09257A48A1}.Debug.ActiveCfg = Debug|.NET
{2022B3FD-6AFB-4912-8687-4B09257A48A1}.Debug.Build.0 = Debug|.NET
{2022B3FD-6AFB-4912-8687-4B09257A48A1}.Debug1.ActiveCfg = Debug|.NET
{2022B3FD-6AFB-4912-8687-4B09257A48A1}.Debug1.Build.0 = Debug|.NET
{2022B3FD-6AFB-4912-8687-4B09257A48A1}.PostCMD.ActiveCfg = Release|.NET
{2022B3FD-6AFB-4912-8687-4B09257A48A1}.PostCMD.Build.0 = Release|.NET
{2022B3FD-6AFB-4912-8687-4B09257A48A1}.PostExplorer.ActiveCfg =
Release|.NET
{2022B3FD-6AFB-4912-8687-4B09257A48A1}.PostExplorer.Build.0 =
Release|.NET
{2022B3FD-6AFB-4912-8687-4B09257A48A1}.Release.ActiveCfg = Release|.NET
{2022B3FD-6AFB-4912-8687-4B09257A48A1}.Release.Build.0 = Release|.NET
{22A37BFE-687D-44E6-9C0C-711735BC5018}.Debug.ActiveCfg = Debug|.NET
{22A37BFE-687D-44E6-9C0C-711735BC5018}.Debug.Build.0 = Debug|.NET
{22A37BFE-687D-44E6-9C0C-711735BC5018}.Debug1.ActiveCfg = Debug|.NET
{22A37BFE-687D-44E6-9C0C-711735BC5018}.Debug1.Build.0 = Debug|.NET
{22A37BFE-687D-44E6-9C0C-711735BC5018}.PostCMD.ActiveCfg = Release|.NET
{22A37BFE-687D-44E6-9C0C-711735BC5018}.PostCMD.Build.0 = Release|.NET
{22A37BFE-687D-44E6-9C0C-711735BC5018}.PostExplorer.ActiveCfg =
Release|.NET
{22A37BFE-687D-44E6-9C0C-711735BC5018}.PostExplorer.Build.0 =
Release|.NET
{22A37BFE-687D-44E6-9C0C-711735BC5018}.Release.ActiveCfg = Release|.NET
{22A37BFE-687D-44E6-9C0C-711735BC5018}.Release.Build.0 = Release|.NET
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal
If you take a look at an .sln file in which solution items have been enabled and added, you'll notice that there's no information about these files. Solution items are considered user items, so links to these files are stored in the solution user options (.suo) file. If you pass a folder containing an .sln and an .suo file to another user on another machine, much of the information in the .suo file will become useless to the second user and will be ignored.Some important items are stored in the .suo file that you can choose to pass to another person. Breakpoints that you set in your solution are stored in the .suo file, as are tasks that have been added to the Task List window. If you want to share that information with the person you're sharing the solution with, you should be sure to keep the .suo file with the .sln file. If you don't need to share such information, we recommend deleting that file because the file can contain personal and confidential data such as the paths to network shares and even your e-mail alias.