ASP.NET Application Configuration

After an application is designed and developed, it needs to be deployed on an application Web Server for launching it as a Web site on the Internet or an intranet. The deployment process includes installation and configuration of the Web application (Web site) on an application Web Server. Configuring a Web site requires implementation of settings according to the server's capabilities and requirements.

Configuring a Web site might also require developers to write code. At a later stage, the site administrator might need to change the settings of the site or the server on which the site has been deployed so as to enhance the performance of the site.

However, if the change in settings involves embedding values into code, it becomes very complicated and difficult for both the developer and the administrator to reconfigure the application.

The application deployment process requires a rich and flexible configuration system. The configuration system should enable developers to easily associate settings with an installable application without having to embed values into code.

The system should also enable administrators to easily adjust or customize these values after the deployment of the application on the application Web Server. The ASP.NET configuration system fulfills both these requirements.

ASP.NET is designed to provide developers with rich support for designing, developing, and deploying Web applications. For application deployment, ASP.NET provides a rich set of configuration settings. The configuration information for the entire ASP.NET application is defined and contained in configuration files. These files are written in XML and are named Web.config. ASP.NET uses a hierarchical configuration architecture that uses an XML format.

In the hierarchical configuration architecture, whenever a client makes a request for an ASP.NET application or a specific ASP.NET resource, ASP.NET checks the settings for the URL requested by the client in a hierarchical fashion. The check is carried out using the configuration files located in the path for the requested URL.

These settings are then logged or cached by the application Web Server to speed up any future requests for ASP.NET resources. To understand the hierarchical configuration architecture better, consider a Web site that has a file structure.

In this file structure, suppose that the Application Root directory is the virtual directory (vdir) mapped for the site. A virtual directory is the main directory for the site, which contains all the files and subdirectories, including the script pages, HTML pages, programs, or any graphics for the site.

Every site must have a virtual directory; the virtual directory might contain many subdirectories. The other two subdirectories within the Application Root directory are not virtual directories. This directory structure allows administrators to configure the application settings.

For example, administrators can configure the application settings, such that all users are given access to the ASP.NET resources in the Application Root directory, but only selected users are given access to the ASP.NET resources in the subdirectories.

Consider a scenrio wherein the Web site has only one Web.config file in the SubDir1 directory. Although the Web site has only one Web.confi g file in the directory structure, the Web site actually uses two Web.config files, because a file named Machine. config exists in the %windir%\Microsoft.NET\Framework\v1.0.\CONFIG directory.

In this path, represents 2914 for the Beta 2 release of the Microsoft .NET Framework SDK. In future releases, this build number will change, and therefore the actual name of the folder might also change. This file is at the highest level and is called the machine-level configuration file. This machine-level configuration file comes with the Microsoft .NET Framework and contains the default settings.

All ASP.NET directories and subdirectories inherit settings from this machine-level configuration file. However, a Web.config file can also be located at the Web site level, and if it is not overridden at a lower level, it will apply to all ASP.NET resources on the Web site.

The default settings of the machine-level configuration file allow access to all users. In this scenario, there is no configuration file in the Application Root directory that modifies the default behavior of the machine-level configuration file; all users will be given access to the ASP.NET resources on the site, because the Application Root directory inherits settings from the machine-level configuration file.

The configuration file located in the SubDir1 directory can have settings that specify access only to certain users. In such a case, all users can access the ASP.NET resources in the Application Root directory, but only certain users can access the ASP.NET resources in both the subdirectories.

The configuration settings for virtual directories are independent of the physical directory structure, and unless the manner in which the virtual directories are organized is exclusively specified, configuration problems might result.

To summarize, the hierarchical configuration architecture provides a flexible and rich configuration system that enables extensible configuration data to be defined and used throughout the ASP.NET applications. The configuration system of ASP.NET has the following benefits in terms of deployment of Web applications:

The configuration information for the ASP.NET applications is stored in XMLbased confi guration files, which makes it easy to read and write.

Administrators and developers can use a standard text editor, XML parser, or Perl script for any kind of interpretation or updating of the configuration settings of the application.

The configuration information files are stored in the same directory tree as the rest of the application files, thus making the installation of ASP.NET applications easy.

The configuration system is highly flexible and allows developers to store customized configuration criteria and settings in the configuration system. This extensibility feature can then be used at run time to affect the processing of the HTTP requests.

The configuration system allows the automation of any configuration updates made to the ASP. NET configuration files. The changes made are applied without requiring any user intervention.
§ The configuration information contained in the XML file is applied hierarchically with regard to the virtual directory structure, which is provided at the time of site creation on the Application Server.

Subdirectories under the virtual directory inherit or override the configuration settings from their parent directories. This allows different settings for different applications or different parts of a single application.

related post

CREATING ASSEMBLIES WITH ASP.NET

BUILDING HANDLERS IN ASP.NET

INTERFACES AND CLASSES CREATION IN ASP.NET

CACHING IN ASP.NET

CACHING IN ASP.NET PART TWO

WIRE LESS APPLICATION WITH ASP.NET

SECURITY IN ASP.NET PART ONE

SECURITY IN ASP.NET PART TWO

LOCALIZING ASP.NET APPLICATIONS

DEPLOYING ASP.NET APPLICATIONS

ASP.NET CONFIGURATION SYSTEM

WEB SERVICES IN ASP.NET

WEB SERVICES PART TWO

WEB SERVICE INFRASTRUCTURE

WEB SERVICE INFRASTRUCTURE PART TWO

EXCHANGING MESSAGES IN ASP.NET

MICROSOFT HAIL STORM

SOAP AND DOT NET PART ONE

SOAP AND DOT NET PART TWO


No comments:

Post a Comment