Creating Solutions and Projects
Projects are the logical containers for everything that's needed to build your application. When you create a project by choosing File | New | Project from the main menu, Visual Studio creates a solution to contain it. You can then add more new or existing projects to the solution if necessary. You can create projects from existing code files and you can create temporary projects (.NET only) that will be deleted when you are done with them.
The descriptions in this topic are based on the Visual Studio Community edition. The dialog boxes and menu commands you see might differ from those described here, depending on your settings or Visual Studio edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Customizing Development Settings in Visual Studio.
File | New | Project from the main menu to bring up the New Project dialog. In the left pane under Intalled | Templates chose the programming language and platform or technology, then choose from the available templates in the middle pane.
In the New Project dialog, the Solution drop-down gives you the option to create the new project in a new or existing solution, or in a new instance of Visual Studio.
If you have a collection of loose source files, you can easily create a project that contains them. Choose File | New |Project From Existing Code to start the Create Project from Existing Code Files Wizard and follow the prompts.
This option works best for relatively simple collections of files.
By working with temporary projects, you can create and experiment with a .NET project without specifying a disk location. When you create a project, you just select a project type and template and specify a name in the New Project dialog box. At any time while you are working with the temporary project, you can save it, or you can discard it.
You can create a project to target earlier versions of the .NET Framework by using the .NET Framework version drop-down menu at the top of the New Project dialog box. Set this value before selecting a project template, as only templates compatible with that .NET Framework version will appear in the list.
You must have .NET Framework 3.5 installed on your system to access framework versions earlier than 4.0.
You can use Visual Studio to download and install sample solutions from the MSDN Code Gallery.
You can download the samples individually, or you can download a Sample Pack, which contains related samples that share a technology or topic. You'll receive a notification when source code changes are published for any sample that you download.
For more information, see Visual Studio Samples.
Sometimes you might have a file that multiple projects refer to, or that contains text or miscellaneous data that logically belongs at the solution level rather than under a specific project. To add a single item to a solution:
Right-click on the solution node in Solution Explorer and choose Add | New Item or Add | Existing Item.
Although a project must reside in a solution, you can create a solution that has no projects.
To create an empty solution
On the File menu, click New and then click New Project.
In the left pane, select Installed, select Other Project Types, and then select Visual Studio Solutions from the expanded list.
In the middle pane, select Blank Solution.
Set the Name and Location values for your solution, then click OK.
After you create an empty solution, you can add new or existing projects or items to it by clicking Add New Item or Add Existing Item on the Project menu.
You can delete a solution permanently, but not by using Visual Studio. Before you delete a solution, move any projects that you might want to use again in another solution. Then use File Explorer to delete the directory that contains the .sln and .suo solution files.
The .suo file is a hidden file that is not displayed under default File Explorer settings.
To delete a solution
In Solution Explorer, right-click the solution to delete, and select Open folder in File Explorer.
In File Explorer, navigate up one level.
Select the directory containing the solution and press Delete.