Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> 電腦軟體教學 >> 伺服器技術 >> 關於伺服器

Windows Server 2008 IIS 部署 WCF 報錯:無法從 System.ServiceModel 載入 HttpModule - aspnet_regiis 修復

編輯:關於伺服器

錯誤訊息

未能從程序集 "System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 中載入類型 "System.ServiceModel.Activation.HttpModule"。

觸發條件

先安裝 .NET Framework 4,再啟用 .NET 3.5 WCF HTTP Activation 功能,導致 ISAPI 對應順序錯亂。

官方修復指令

以管理員身分開啟命令提示字元,執行:

aspnet_regiis.exe -i -enable

路徑通常為:

  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe (32 位)
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe (64 位)

原理

重新註冊 ASP.NET 4 的 ISAPI 擴展與對應,修正 HttpModule 載入順序,恢復 WCF HTTP Activation 正常運作。

驗證

瀏覽器訪問 .svc 服務端點,應正常返回 WSDL 或服務說明頁面。

參考

Microsoft 官方文件:WCF HTTP Activation Issues

Copyright © Windows教程網 All Rights Reserved