Understanding Solutions

From a programming perspective, everything that you do within Visual Studio takes place within the context of a solution. As mentioned in this chapter’s introduction, solutions in and of themselves don’t do anything other than serve as higher-level containers for other items. Projects are the most obvious items that can be placed inside solutions, but solutions can also contain miscellaneous files that may be germane to the solution itself, such as “read me” documents and design diagrams. Really, any file type can be added to a solution. Solutions can’t, however, contain other solutions. In addition, Visual Studio loads only one solution at a time. If you need to work on more than one solution concurrently, you need to launch another instance of Visual Studio.

So what do solutions contribute to the development experience? Solutions are useful because they allow you to treat different projects as one cohesive unit of work. By grouping multiple projects under a solution, you can work against those projects from within one instance of Visual Studio. In addition, a solution simplifies certain configuration tasks by enabling you to apply settings across all the solution’s child projects.

You can also “build” a solution. As mentioned previously, solutions themselves aren’t compiled, per se, but their constituent projects can be built using a single build command issued against the solution. Solutions are also a vehicle for physical file management: because many items that show up in a solution are physical files located on disk, Visual Studio can manage those files in various ways (delete them, rename them, move them). So it turns out that solutions are useful constructs within Visual Studio.

The easiest way to explore solution capabilities and attributes is to create a solution in the IDE.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset