Windows

從 Windows Server 2013 升級到 Windows Server 2016(或從 Win 8.1 升級到 Win 10)後 IIS 應用程序池出錯

  • November 22, 2017

將我的 Windows 安裝從 8.1 升級到 10 後,許多應用程序池無法啟動,在事件查看器中顯示以下條目:

應用:

Source: IIS-W3SVC-WP
Event ID: 2307
The worker process for application pool '<app pool name>' encountered an error 'Cannot read configuration file' trying to read configuration data from file '\\?\<EMPTY>', line number '0'. The data field contains the error code.

系統:

Source: WAS
Event ID: 5189
The Windows Process Activation Service failed to generate an application pool config file for application pool '<app pool name>'. The error type is '5'. To resolve this issue, please ensure that the applicationhost.config file is correct and recommit the last configuration changes made. The data field contains the error number.

Source: WAS
Event ID: 5203
A process serving application pool '<app pool name>' reported a failure trying to read configuration during startup. The process id was '4120'.  Please check the Application Event Log for further event messages logged by the worker process on the specific error.  The data field contains the error number.

我發現很多人說要重新安裝 IIS/WAS,但是即使這樣做了,錯誤仍然存在。

出於某種原因,使用另一個名稱重新創建應用程序池可以修復錯誤,但我不想保持這種狀態。將 App Pool 重命名回原來的名稱後,它再次開始失敗。

在使用出色的程序監視器分析Windows 程序啟動服務試圖讀取/創建的文件後,我發現這些文件和目錄C:\inetpub\temp\apppools可能在 Windows 升級過程中搞砸了。我刪除了那些舊文件和目錄並重新啟動了應用程序池。

現在一切正常!

引用自:https://serverfault.com/questions/881870