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 (,).

Value Description
bitness32 Specify the bitness32 value when the module is a 32-bit .dll file. IIS should load the handler only for worker processes that run in WOW64 mode (32-bit simulation) on a 64-bit operating system.
bitness64 Specify the bitness64 value when the module is a 64-bit .dll file. IIS should load the handler only for worker processes that run in 64-bit mode.
integratedMode Specify the integratedMode value when the module should respond only to requests in application pools that are configured to use the integrated request-processing pipeline.
ISAPIMode Specify the ISAPIMode value when the module should respond only to requests in application pools that are configured to use Classic mode.
managedHandler Specify the managedHandler value when the module should process requests only for managed resources, such as .aspx files, and should not respond to requests for non-managed resources, such as .html files.
runtimeVersionv1.1 Specify the runtimeVersionv1.1 value when the module should respond only to requests in application pools that are configured to use .NET Framework version 1.1.
runtimeVersionv2.0 Specify the runtimeVersionv2.0 value when the module should respond only to requests in application pools that are configured to use .NET Framework version 2.0.
winarm Specify the winarm value when the module is an ARM-native module. IIS should load the handler only for ARM-native worker processes when running Windows on ARM64.

Note: This property is in the schema, but it is currently not supported.

winx86_64 Specify the winx86_64 value when the module is a 32-bit or 64-bit dll that was built for x86 / x64 processors. IIS should load the handler only for ARM64EC ("Emulation Compatible") worker processes, when running Windows on ARM64.

Note: This property is currently only available on Windows 11 starting with KB5014697.

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