Visual Studio .NET uses projects and solutions to organize your applications. A project contains user interface and source files, as well as other files such as data sources and graphics. Typically, the contents of a project are compiled into an assembly, e.g., an executable file (.exe) or a dynamic link library file (DLL). You can create many types of projects in Visual Studio 2005, including:
15.2.1. TemplatesWhen you create a new project by clicking the New Project... link on the Start Page or File New Project ..., you get the New Project dialog box , as shown in Figure 15-3. Figure 15-3. New Project dialog box
To create a new project, you select a project type and a template. There are a variety of templates for each project type. For example, the templates for Visual Basic 2005 Projects, shown in Figure 15-3, are different from the templates available to Other Project Types Setup and Deployment. By selecting a Visual Studio Solutions project type, you can create an empty solution, ready to receive whatever items you want to add. The template controls what items will be created automatically and included in the project, as well as default project settings. For example, if your project is a Visual Basic 2005 Web application, then web forms (.aspx) files and language-specific code-behind (.vb) files will be created as part of the project. If a different template is selected, then an entirely different set of files will be created. 15.2.2. Web SitesA typical .NET web application is comprised of many items: content files (e.g., .aspx files), source files (e.g. .vb files), assemblies (e.g. .exe and .dll files) and assembly information files, data sources, references, and icons, as well as miscellaneous other files and folders. Visual Studio 2005 organizes these items into a folder that represents the web site. The web site folder is housed in a solution. When you create a new web site, Visual Studio 2005 automatically creates the solution. To create a new web application, either click on New Web Site ... from the Getting Started box on the Start Page, or go to File New Web Site ... In either case, you will get the New Web Site dialog box, as shown in Figure 15-4. It will present lists of available templates, described shortly. Figure 15-4. New Web SiteBelow the list of templates are a set of controls for setting the location and language for your web site. The first drop down, Location, allows you to work on web applications in three different manners, from three different types of locations. The choice here controls much more than just a physical location.
15.2.3. SolutionsSolutions typically contain one or more projects and/or web sites. They may contain other, independent items as well. These independent solution items are not specific to any particular project, but apply, or scope, to the entire solution. The solution items are not an integral part of the application, because they can be removed without changing the compiled output. They display in Solution explorer (described later in this chapter) in a Solution Items folder, and can be managed with source control. Miscellaneous files are independent of the solution or project, but they may be useful to have handy. They are not included in any build or compile, but will display in the Solution explorer and may be edited from there. Typical miscellaneous files include project notes, database schemas, or sample code files. To display the Miscellaneous Files folder as part of the solution, go to Tools Options Environment Documents, and check the checkbox for Show Miscellaneous Files in Solution explorer. It is also possible to have a solution that does not contain any projects just solution items or miscellaneous files , which can be edited using Visual Studio 2005. Solutions are defined by a solution file, created by Visual Studio 2005 and named for the solution with a .sln extension. The .sln file contains a list of the projects that comprise the solution, the location of any solution-scoped items, and any solution-scoped build configurations. Visual Studio 2005 also creates a .suo file with the same name as the .sln file (e.g., mySolution.sln and mySolution.suo). The .suo file contains data used to customize the IDE on a per-user and per-solution basis.
The solution file is placed in the Visual Studio projects location. By default it will look like the following (with your user name substituted): c:\Documents and Settings\username\My Documents\Visual Studio\Projects However, you can change it to something a little easier to navigate, such as: c:\vsProjects by going to Tools Options Projects and Solutions General. You can open a solution in Visual Studio 2005 by double-clicking the .sln file in Windows Explorer. Even if the .sln file is missing, you can still open a project in Visual Studio 2005. A new .sln file will be created when you save.
|