Configuring ASP.NET Applications

ASP.NET has a sophisticated configuration system, managed by configuration files at the machine, application, and Web page level. These configuration files are integral to the operation of a Web site, so understanding them is important to success in ASP.NET development. All configuration files are written in XML, which makes them accessible to both human and machine.

At the machine level is a file named machine.config, which is located at %windir%\Microsoft.NET\Framework\<version>\CONFIG. There is a separate machine.config for each version of the .NET Framework on each computer, but there can only be one machine.config file on a single machine for each version. Table 11.6 describes the version numbers and which version of the .NET Framework they belong with. Changes to the machine.config are relatively rare, so remember to be sure you are working with the proper version of machine.config when making changes. Otherwise, you may not see the effects of the modifications.

Table 11.6. .NET Framework Version Numbers

NUMBER

FRAMEWORK

v1.0.3705

.NET Framework Version 1.0

v1.1.4322

.NET Framework Version 1.1

Configuration settings in the machine.config file apply to all ASP.NET applications on an entire machine. This file is much too long to list in this chapter, but it does contain decent documentation and it is interesting to open and read the comments for each configuration setting.

At the application level, there are web.config files that are specific to that application only. Often there will be application settings that are available both programmatically and via config files. For example, the Trace attribute may be specified in the Page directive for a specific Web Form, but if Trace is set in the web.config file, it will apply to the entire application. Each configuration file has its own settings that support the requirements of the application it belongs with. Also, there are many different types of possible configuration settings, so it is best to consult documentation on a given configuration setting to know how best to set it. As with the machine.config file, it would be a good idea to read the comments in the default web.config created with the ASP.NET application to get a feel for what type of information is put into the web.config file.

Besides application-level configuration, another web.config file may be located in a subdirectory below the application web.config file. Changes in web.config files in subdirectories override the settings at the application level for those Web Form pages in the same subdirectory.



C# Builder KickStart
C# Builder KickStart
ISBN: 672325896
EAN: N/A
Year: 2003
Pages: 165

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