Module has an invalid precondition

Microsoft.Windows.InternetInformationServices.2008.Module.has.an.invalid.precondition (Rule)

Knowledge Base article:

Summary

Internet Information Services (IIS) 7 enables developers to easily configure native and managed code modules that process requests made to the Web server. In order for worker processes to load them, the modules must be configured correctly. Proper module configuration requires that the module have a unique name, and a valid type or path. Managed modules can specify whether they should be invoked only for requests to ASP.NET applications or managed handlers. When specified, this setting can optimize performance.

Resolutions

Correct a module's preconditions

Module entries have an optional preCondition attribute that can contain conditions for the module to be loaded. For example, the preCondition can specify that IIS load the module only for application pools that run in integrated mode, only for application pools that run in ISAPI mode, or only for application pools that use a specified .NET Framework version. This last setting makes it possible to use separate versions of the managed engine module for application pools that use different versions of the CLR runtime.

Here is an example from the globalModules section of the ApplicationHost.config file of a module entry that has a preCondition attribute :

<globalModules>

     <add name="ManagedEngine"

           image="%Windir%\Microsoft.NET\Framework\v2.0.50727\webengine.dll"

           preCondition="integratedMode,runtimeVersionv2.0,bitness32"

      />

</globalModules>

Before loading each module, the server evaluates the precondition if one is present in configuration. If any one of the load preconditions return false, the module is not loaded.

To resolve this issue:

Back up the ApplicationHost.config file

To back up the ApplicationHost.config file:

A directory with the backup name that you specify will be created under the %Windir%\system32\inetsrv\backup directory. If you do not specify a name, Appcmd.exe will generate a directory name automatically using the current date and time.

Find the module entry in the ApplicationHost.config file

To find the module entry in the ApplicationHost.config file:

For more information about the globalModules section, see IIS 7: add Element for globalModules (IIS Settings Schema).

Element properties:

TargetMicrosoft.Windows.InternetInformationServices.2008.WebServer
CategoryAlert
EnabledTrue
Event_ID2296
Event SourceMicrosoft-Windows-IIS-W3SVC-WP
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
RemotableTrue
Alert Message
Module has an invalid precondition
{0}
Event LogApplication

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.EventProvider Default
WA WriteAction Microsoft.Windows.Server.IIS.2008.GenerateAlertAction.SuppressedByDescription Default

Source Code:

<Rule ID="Microsoft.Windows.InternetInformationServices.2008.Module.has.an.invalid.precondition" Enabled="onEssentialMonitoring" Target="Microsoft.Windows.InternetInformationServices.2008.WebServer" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>Alert</Category>
<DataSources>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.EventProvider">
<ComputerName>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>Application</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Microsoft-Windows-IIS-W3SVC-WP</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>2296</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WA" TypeID="Microsoft.Windows.Server.IIS.2008.GenerateAlertAction.SuppressedByDescription">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.Windows.InternetInformationServices.2008.Module.has.an.invalid.precondition.AlertMessage"]$</AlertMessageId>
</WriteAction>
</WriteActions>
</Rule>