Name
<location>
Synopsis
<location
path=pathToConfigure
allowOverride=boolean >
<system.web>
<! -- Configuration settings -- >
</system.web>
</location>Allows you to prevent settings in machine.config
or web.config from being overridden in child
configuration files. You can also use it to configure settings for
specific files or folders from a configuration file in a parent
folder.
Scope
Any
Attributes
-
path Specifies the path to the file or folder to which the configuration settings contained in the
<location>tag pair should be applied.-
allowOverride Specifies whether child configuration files can override values configured within the
<location>tag pair. This attribute locks down configuration settings (i.e., at themachine.configlevel) for which you want to enforce uniformity.
Child Elements
<system.web>
Example
The example, if used in machine.config, would force all applications
on the machine to use Windows authentication:
<configuration>
<location
allowOverride="false">
<system.web>
<authentication mode="Windows">
</system.web>
</location>
<system.web>
<!-- Other configuration settings -->
</system.web>
</configuration>Notes
This tag provides powerful control over configuration. In addition to
the scenario of enforcing an authentication method across all
applications, you can also use the path attribute
to configure multiple child folders or files from the web.config file in the root of the
application. Using this configuration can avoid having a large number
of child web.config ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access