Section 4.1. Start Page

   

4.1 Start Page

The Start Page is the first thing you see when you open Visual Studio .NET (unless you configure it otherwise ). From here you can create new projects or open a project you worked on in a previous session. You can also find out what is new in .NET, access .NET newsgroups and web sites, search for help online, download useful code, or adjust Visual Studio .NET to your personal requirements. Figure 4-1 shows a typical Start Page.

Figure 4-1. Start Page
figs/lcs_0401.gif

Along the top of the application window is a set of menus and buttons. These menus and buttons are context-sensitive (i.e., they will change as the current window changes).

Along the left side of the window is a series of links to other resources, such as new developments and events in the .NET community, the MSDN online library, and free sample applications.

4.1.1 Projects and Solutions

A C# program is built from source files, which are text files containing the code you write. Source code files are named with the .cs extension. The HelloWorld.cs file you created in Chapter 2 is an example.

A typical Visual Studio .NET application can have a number of other files (e.g., assembly information files, references, icons, data connections, etc.). VS.NET organizes these files into a container called a project .

Visual Studio .NET provides two types of containers for your source code, folders, files, and related material: the project and the solution. A project is a set of files that work together to create an executable program (. exe ) or a dynamic link library (. dll ). Large, complex projects may consist of multiple .dll files called modules.

A solution is a set of one or more related projects. Each time you create a new project, Visual Studio .NET either adds it to an existing solution or creates a new solution.

Solutions are defined within a file named for the solution and have the extension .sln .

The .sln file contains metadata, which is basically information about the data. The metadata describes the projects that compose the solution and information about building the solution. Visual Studio .NET also creates a file with the same base name as the .sln file, but with the filename extension .sou (e.g., mySolution.sln and mySolution.sou ). The .sou file contains metadata used to customize the IDE.

There are a number of ways to open an existing solution. The simplest way is to select Open Project from the Start menu (which opens a project and its enclosing solution). Alternatively, you can open a solution in Visual Studio .NET just by double-clicking the .sln file in Windows Explorer.

Typically, the build process results in the contents of a project being compiled into an executable ( .exe ) file or a dynamic link library ( .dll ) file. This book focuses on creating executable files.

The metadata describing the project is contained in a file named after the project with the extension . csproj . The project file contains version information, build settings, and references to other source files to include as part of the project.

4.1.2 Templates

When you create a new project, you get the New Project dialog box, shown in Figure 4-2.

Figure 4-2. New Project dialog lets you choose a project template
figs/lcs_0402.gif

In the New Project dialog, you select the project type (in the left-hand pane) and the template (in the right). There are a variety of templates for each project type. A template is a file that Visual Studio .NET uses to set up the initial state of your project.

For the examples in this book, you'll always choose Visual C# Project for the project type, and in most cases, you'll choose Console Application as the template. Specify the name of the directory in which your project will be stored (any directory you like). At this point, you can also name your project. For the purposes of example, enter the name HelloWorld.

Project names can contain any standard characters, except leading or trailing spaces, Windows or DOS keywords, and any of the following special characters :

 # % & *  \ : " < > ? / 
   


Learning C#
Learning C# 3.0
ISBN: 0596521065
EAN: 2147483647
Year: 2005
Pages: 178

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net