#483 – Adding a new Project to an Existing Solution

A solution in Visual Studio can contain one or more projects.  When you create a new solution using the New Project wizard, you typically get a solution with a single project.

You can add additional projects to a solution at any time, representing additional components that will be built when you build all source code in the solution.

As an example, suppose that you use the New Project wizard to create a WPF Application called MyWPFApp.  You’ll get a solution with a single project.

Now let’s say that you want to add a class library (DLL) to your project.  You right-click on the solution in the Solution Explorer and select Add | New Project.

You’ll get the Add New Project dialog, where you can select Class Library as the project type, give the project a name, and press OK.

You’ll now see the new project in the Solution Explorer.


#481 – Projects and Solutions in Visual Studio

When you work with Visual Studio to develop an application, you organize your source code into projects and solutions.

Projects contain items such as your source code files and typically are configured to produce a single deployable object at build time, like a Console Application (.exe), WPF Application (.exe) or a Class Library (.dll).  A project is something that you can build individually, generating the desired output (like an .exe or .dll file).

Solutions act as containers for projects.  You can perform certain operations, like building the software, for the entire solution.

When you open Visual Studio, you typically open a solution.  You then use the Solution Explorer to view and manage items contained in projects within that solution.

The example below shows a solution (ConsoleApplication1) that contains two projects–a Console Application packaged as an .exe file (ConsoleApplication1) and a class library packaged as a .dll file (DogLibrary).