Visual C# Express - Solutions and Projects


Jump to: navigation, search
Visual C# Express
edit
Visual C# Express: Solutions and Projects

Before developing any applications, an understanding of the differences between a solution and a project is required. A project holds source files and any other files, such as images, that are needed to create an assembly that is to be run by the .NET Common Language Runtime. All of the source files in a project are compiled together to create a single assembly. The assembly may be an executable (.exe) or a dynamic link library (.dll).

A solution can hold one or more projects, but often contains just a single project. If this is the case, then there is really no difference between a solution and a project. A solution that contains more than one project is suitable for large applications that are developed by more than one person. This allows individuals or small groups of developers to independently work on the projects that make up the solution.


How to create a new project

To create a new project, either click on the new projects label in the Recent Projects window or choose New Project from the File menu. Alternatively you can use the keyboard shortcut by pressing the control, shift and ā€˜N’ keys at the same time. This latter method is one of a number of keyboard shortcuts that are available in the Integrated Development Environment and are shown in the following manner;

Ctrl+Shift+N


How to open and close existing projects

To open a project, either click on a recent project on the Start page, or choose Open Project... from the File menu. Alternatively, the keyboard shortcut is;

Ctrl+Shift+O


To close a project, you actually need to close the solution that it is a part of. To do this, choose Close Solution from the File menu. This may seem confusing that we refer to closing a project, by clicking on the Close Solution menu item, but remember that by closing the solution, we are also closing all of the projects within it. There is no shortcut associated with closing a project, however if you wish to close the whole application then this can be achieved using;

Alt+F4


Image:02-open.jpg

Figure 2: Visual C# Express - Open Project Dialog


Summary

  • Every project has a project file with an extension of csproj that keeps track of the files that make up the project.
  • Every solution has a solution file with an extension of sln that keeps track of the projects that make up the solution.
  • When you open a project, the IDE automatically opens the solution that it is a part of. Similarly, when you open a solution, the IDE automatically opens all of the projects that are located in the solution.
  • A solution may contain projects that are written in more than one .NET supported language, although C# Express does not give you the ability to do this.
  • C# Express uses a file with the extension suo to record all of the options that you might associate with your solution so that each time you open it, it includes customizations that you have made.


Previous_Page_.gif Next_Page_.gif


Personal tools