add Element for modules for system.webServer [IIS Settings Schema]
Note
For more information about the add element, see the following topic on the Microsoft IIS.net Web site: Adding Modules <add>.
Adds a native or managed module to the modules collection.
Note
Native modules added to the modules collection must also be in the globalModules collection.
Syntax
Attributes and Elements
The following sections describe attributes, child elements, and parent elements for this section.
Attributes
Attribute |
Description |
||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
Required string attribute. Specifies the unique name of a native or managed module on the Web server. |
||||||||||||||||||||
preCondition |
Optional string attribute. Specifies conditions under which the module will run. The preCondition attribute can be one or more of the following possible values. If you specify more than one value, separate the values with a comma (,).
|
||||||||||||||||||||
type |
Optional string attribute. Specifies the managed type of a managed module. The type attribute does not apply to native modules. |
Child Elements
None.
Parent Elements
Element |
Description |
---|---|
configuration |
Specifies the root element in every configuration file that is used by IIS 7. |
system.webServer |
Specifies the top-level section group (in ApplicationHost.config) in which this element is defined. |
modules |
Specifies configuration settings for modules on a Web server. |
Remarks
For more information about the add element, see the following topic on the Microsoft IIS.net Web site: Adding Modules <add>.
Example
The following example adds a native module and a managed module to the configuration.
Note
The lockItem attribute, besides being used to lock any individual element, can also be used on collection elements to lock them specifically within a specified collection. Also, the attribute can be used to lock any entire section.
<modules>
<add name="ImageModule" lockItem="true" />
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule" preCondition="managedHandler" />
</modules>
Element Information
Configuration locations |
Machine.config ApplicationHost.config Root application Web.config Application Web.config |
Requirements |
Microsoft Internet Information Services (IIS) version 7.0 |