ASP.NET Configuration System

When you install a new application, you may be required to configure it. For example,you may need to provide information about the amount of memory to be used by the application. In addition, you may need to specify application-specific information, such as the path for the data source. A configuration system provides all this information for an application, which may be used at the time of or after the deployment of the application.

A Web application should provide a flexible configuration system that allows configuration settings to be easily applied to the application. It should also facilitate easy customization of configuration settings after the deployment of the application so that changes in the configuration settings can be applied to the application without having to recompile the entire code. In addition, the configuration system should provide a rich set of configuration settings to enable different types of Web clients to work with the applications.

The configuration system provided in ASP.NET meets all of these requirements. It provides a flexible configuration system, as well as a rich set of initial configuration settings. A thorough understanding of the configuration system helps you to easily specify the settings for the target computer. You can also easily change the settings after the application is deployed.

In ASP.NET, the configuration file Web.config stores the information about browser capabilities, compilation, custom error messages, security, and globalization. The Web.config file stores the configuration information in an XML format; therefore, it can be easily read and modified by developers by using any standard text editor. Developers can also use scripting languages such as Perl and VBScript to navigate, interpret, and modify the configuration settings specified in the file.


ASP.NET provides a default configuration file for the entire Web server. This file provides the default settings for an ASP.NET application. This file, called Machine.config, is located in the %windir%\Microsoft.NET\Framework\version\CONFIG folder and is available at the machine level. In addition to this machine-level file, you can create your own Web.config file that specifies the settings for a particular application.

When a user makes a request for a resource, ASP.NET determines the configuration settings for the resources by referring to the settings in the Web.config file located in the path of the resource. In the absence of this file, ASP.NET refers to the settings in the Machine.config file.

Deploying Classes and Assemblies

A Windows application is composed of different types of files, such as EXEs and DLLs. When you deploy a new application, it might result in the installation of all the files that comprise the application. However, this may cause a number of problems, especially in case of applications that use COM-based components. COM components need to be registered so that the system can locate them. This requires several Registry settings, in the absence of which the components do not work. In addition, if an application results in installing a newer version of a component, which is shared by a number of applications on a computer, the existing applications might not work as expected.

To overcome the problems of COM-based components and to simplify the process of deploying classes and components, .NET introduces the concept of assemblies. An assembly is a single logical unit of functionality. It is the fundamental unit of class deployment.

An assembly contains an assembly manifest, which contains data about the dependencies of the files that are included in the assembly, their version requirements, security information, and all other information required to resolve references to resources and classes in the assembly.

After you have created an assembly, you can easily deploy it by using Windows Installer (as an MSI file), by using Internet Explorer (as CAB files), or simply by copying the assembly to the target computer. An assembly can be deployed into the local assembly cache or the global assembly cache. The local assembly cache is specific to an application. On the other hand, when you install an assembly into a global assembly cache, it can be accessed by all applications on a computer.

Usually, assemblies are deployed into the local assembly cache of the application. This ensures that the assembly can be accessed only by the code in the application. It also facilitates side-by-side versions of an application to run simultaneously, because the classes of the assemblies are private to a particular application version instance. You can deploy an assembly into the local assembly cache by copying the assembly files in the directory, which is marked as the assembly cache location for an application.

ASP.NET applications are configured to use the bin directory specific to an application as the default local assembly cache. Therefore, you can copy the assembly files to the bin directory of the application.

You can install an assembly into the global assembly cache, using Windows Installer, when you want multiple applications to share the code in the assembly. Windows Installer 2.0 provides the reference-counting feature for assemblies that are shared by multiple applications.

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