ASP+ configuration files are XML-based text files û each named config.web û that can appear in any directory on an ASP+ Web
Application Server.
Each config.web file applies configuration settings to the directory it is located within and all virtual child directories beneath it. Settings in
child directories can optionally override or modify settings specified in parent directories. A root configuration file û
WinNT\ComPlus\<version>\config.web û provides default configuration settings for the entire machine.
ASP+ configures IIS to prevent direct browser access to config.web files (ensuring that their values canÆt become public) û
returning 404: Forbidden errors when attempts are made to do so).
<p>
At runtime ASP+ uses these config.web configuration files to hierarchically compute a unique collection of settings for each incoming
URL target request (note: these settings are only calculated once and then cached across subsequent requests û ASP+ automatically
watches for file changes and will invalidate the cache if any of the configuration files change).
<p>
For example, the configuration settings for the URL: <u>http://myserver/myapplication/mydir/page.aspx</u> would be computed by applying
config.web file settings in the following order:
<p>
<div class="code"><pre>
C:\WinNT\ComPlus\1710\config.web <= Base Configuration Settings for Machine
D:\MyApplication\config.web <= Overriden by Application Configuration Settings
D:\MyApplication\MyDir\config.web <= Overriden by Sub-Directory Config Settings
</pre></div>
If a config.web file is present at the root directory for a site, for example "Inetpub\wwwroot", those configuration settings will apply to every application in that site. Note that the presence of a config.web file within a given directory or application root is completely optional. If a config.web file is not present, then all configuration settings for the directory are automatically inherited from the parent directory.
<h5>Configuration Section Handlers and Sections</h5>
A config.web configuration file is an XML-based text file that can contain standard XML document elements û
including well-formed tags, comments, text, cdata, etc. The file may ANSI, UTF-8, or Unicode -- the system will automatically detect the encoding.
The root element of a config.web file is always a <configuration> tag. ASP+ and end-user settings are then encapsulated within this
tag:
<div class="code"><pre>
<configuration>
<!ù Configuration Settings Would Go Hereà -->
</configuration>
</pre></div>
The <configuration> tag typically contains two different types of elements: 1) configuration section handler declarations, and
2) configuration section settings.
<p>
<ul>
<li><b>Configuration Section Handlers</b> - The ASP+ configuration infrastructure makes no assumptions regarding the file-format or supported settings within a config.web file.
Instead, it delegates the processing of config.web data to "configuration section handlers" û NGWS runtime classes that implement the
IConfigurationSectionHandler interface. An individual IConfigurationSectionHandler declaration only needs to appear once, typically at the
machineÆs root config.web file. The config.web files in child directories automatically inherit this declaration.
Configuration section handlers are declared within a config.web file using "add" tag directives nested within a containing
<configsections> tag. Each ôaddö tag identifies a tag name denoting a specific section of configuration data, and an
associated IConfigurationSectionHandler class that processes it.
<p>
<li><b>Configuration Sections</b> - ASP+ configuration settings are represented within "configuration tag sections", also nested within a <configuration> tag. For each
configuration section, an appropriate section handler must be defined in the config hierarchy. For example, in the sample below the
tag <httpmodules> is the configuration section that defines the "httphandlers" configuration data. It is the
System.Web.Configuration.HttpModulesConfigurationHandler class that is responsible for interpreting the content contained
<td><b><httpmodules></b></td><td>Responsible for configuring Http Modules within an application. Http Modules pariticipate in the processing of every request into an application, and common uses include security and logging.</td>
</tr>
<tr>
<td><b><httphandlers></b></td><td>Responsible for mapping incoming URLs to IHttpHandler classes. Sub-directories do not inherit these settings.
Also responsible for mapping incoming URLs to IHttpHandlerFactory classes. Data represented in <httphandlerfactories> sections are hierarchically inherited by sub-directories. For more information about this configuration section, refer to the <a href="httphandlers.aspx">Http Handlers and Factories</a> section of this tutorial.</td>
</tr>
<tr>
<td><b><sessionstate></b></td><td>Responsible for configuring the session state HttpModule. For more information about this configuration section, refer to the <a href="stateoverview.aspx">Managing Application State</a> section of this tutorial.</td>
</tr>
<tr>
<td><b><globalization></b></td><td>Responsible for configuring the globalization settings of an application. For more information about this configuration section, refer to the <a href="internationalization.aspx">Localization</a> section of this tutorial.</td>
</tr>
<tr>
<td><b><compilation></b></td><td>Responsible for all compilation settings used by ASP+. For more information about this configuration section, refer to the <a href="businessobjs.aspx">Business Objects</a> and <a href="debugcomsdk.aspx">Debugging</a> sections of this tutorial.</td>
</tr>
<tr>
<td><b><trace></b></td><td>Responsible for configuring the ASP+ trace service. For more information about this configuration section, refer to the <a href="tracingoverview.aspx">Tracing</a> section of this tutorial.</td>
</tr>
<tr>
<td><b><security></b></td><td>Responsible for all security settings used by the ASP+ security HttpModule. For more information about this configuration section, refer to the <a href="securityoverview.aspx">Security</a> section of this tutorial.</td>
</tr>
<tr>
<td><b><iisprocessmodel></b></td><td>Responsible for configuring the ASP+ process model settings on IIS Web Server Systems. </td>
</tr>
<tr>
<td><b><browsercaps></b></td><td>Responsible for controlling the settings of the browser capabilities component. For more information about this configuration section, refer to the <a href="configretrieve.aspx">Retrieving Configuration</a> section of this tutorial.</td>