偵測到模組註冊錯誤 (模組在註冊期間傳回錯誤)

Microsoft.Windows.InternetInformationServices.6.2.Module.registration.error.detected.module.returned.an.error.during.registration (Rule)

Knowledge Base article:

摘要

Internet Information Services (IIS) 8 可讓開發人員輕鬆設定原生與受管理的程式碼模組,這些模組負責處理網頁伺服器發出的要求。為讓工作者處理序能夠將它們載入,必須正確設定模組。在正確的模組組態中,模組必須具有唯一名稱,以及一個有效類型或路徑。受管理模組可指定是否只有對 ASP.NET 應用程式或對受管理處理常式的要求應呼叫這些模組。指定之後,此設定便可將效能最佳化。

解決方式

修正模組的註冊

在 IIS8 環境中,模組是可訂閱伺服器事件的邏輯實體。Web 伺服器已設定為在伺服器啟動時載入模組。伺服器在啟動期間會要求模組註冊其感興趣的事件。模組實作會負責為模組註冊其所需的事件。如果模組不具有有效的進入點可讓伺服器存取以進行註冊,註冊便會失敗。

若要解決此問題,請按照下列步驟進行:

建立 ApplicationHost.config 檔案的備份

建立 ApplicationHost.config 檔案的備份:

系統將在 %Windir%\system32\inetsrv\backup 目錄底下使用您指定的備份名稱建立一個目錄。如果您不指定名稱,appcmd 會自動使用目前的日期和時間來產生目錄名稱。

將模組從設定中移除

將模組從設定中移除:

如需有關 globalModules 區段的詳細資訊,請參閱 IIS 8: 新增 globalModules 的元素 (IIS 設定結構描述) (英文)。

Element properties:

TargetMicrosoft.Windows.InternetInformationServices.6.2.WebServer
CategoryAlert
EnabledTrue
Event_ID2293
Event SourceMicrosoft-Windows-IIS-W3SVC-WP
Alert GenerateFalse
RemotableTrue
Event LogApplication

Member Modules:

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

Source Code:

<Rule ID="Microsoft.Windows.InternetInformationServices.6.2.Module.registration.error.detected.module.returned.an.error.during.registration" Enabled="true" Target="Microsoft.Windows.InternetInformationServices.6.2.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>2293</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WA" TypeID="Microsoft.Windows.Server.IIS.6.2.GenerateAlertAction.SuppressedByDescription">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.Windows.InternetInformationServices.6.2.Module.registration.error.detected.module.returned.an.error.during.registration.AlertMessage"]$</AlertMessageId>
</WriteAction>
</WriteActions>
</Rule>