今天說一個在企業內部或網路管制環境安裝 IIS 可能會遇到的問題 - Windows 10 / Windows Server 2016 之後的版本,常因設定了 Windows Update Server 或不能上機造成 IIS 無法安裝 ASP.NET 3.5 模組,用 GUI 或PowerShell Enable-WindowsOptionalFeature 指令都會出錯。

依錯誤代碼分兩種狀況,0x800f0954 多起因企業自建 Windows Update Server,若主機可以直接上網下載,有個解法是修改 Registry 暫時停用 Windows Update Server,裝好再啟用:參考

若主機無法連上網際網路,則會出現錯誤代碼 0x8024402c,此時需改由安裝媒體取得 .NET Framework 3.5 安裝程式。掛載安裝媒體後,假設目錄為 E:\sources\sxs,則 PowerShell Enable-WindowsOptionalFeature 指令可加上 -Source E:\sources\sxs 參數指定來源(記得要以管理者權限執行):

Enable-WindowsOptionalFeature -Online -All -FeatureName IIS-NetFxExtensibility -Source E:\sources\sxs
Enable-WindowsOptionalFeature -Online -All -FeatureName IIS-ASPNET -Source E:\sources\sxs

這樣應該就能成功安裝了。

Tips of how to resolve error 0x800f0954 / 0x8024402c while installing ASP.NET 3.5 on IIS of Windows 10+/Windows Server 2016+.


Comments

# by Slant

如果是企業有架Windows Update Server造成的0x800f0954,提供另外幾乎一樣的解法(非Registry,小弟也是同樣的問題遇過好幾次,每次解完就忘了,但因為解太多次,不小心就記起來了) Search -> Edit Group Policy -> Computer Configuration -> Administrative Templates -> System -> Specify settings for optional component installation and component repair -> (Checkbox)Enabled -> (Checkbox)Download repair content and optional features directly from Windows Update instead of Windows Server Update Services(WSUS) 若無法連線,也可設定Alternate source file path: \\shareserver\sources\sxs

# by Jeffrey

to Slant,謝謝分享,從網域管理角度一次搞定,好方法!

Post a comment