首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 編程語言 >  >> .NET 網頁程式設計 >> ASP.NET 基礎 >> 關於ASP.NET

解決 ASP.NET 2.0 安裝後 IIS 出現 Server Application Unavailable 錯誤

     編輯:關於ASP.NET

伺服器原運行 ASP.NET 1.1 正常,安裝 .NET Framework 2.0 後,網站出現 Server Application Unavailable 錯誤。事件檢視器記錄:Error: 0x80070005 Access is denied. Failed to execute request because the App-Domain could not be created. 根因為 ASP.NET 1.1 與 2.0 版本衝突,導致應用程式集區身分識別權限不足。

錯誤完整訊息

Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable.
Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure 
can be found in the application event log of the web server.

事件檢視器詳細錯誤

Error: Failed to execute request because the App-Domain could not be created. 
Error: 0x80070005 Access is denied.

根本原因分析

.NET Framework 2.0 安裝會註冊新的 ASP.NET ISAPI 對應,但現有網站的應用程式集區仍使用舊版身分識別(如 ASPNET 本地帳戶),且虛擬目錄的 NTFS 權限缺少新版本所需的帳戶(Network Service、Local Service、IWAM_<MachineName>),導致應用程式域建立失敗。

解決步驟

  1. 開啟 IIS 管理員,右鍵網站 → 內容 → 主目錄 / 虛擬目錄 標籤。
  2. 點擊 設定 → 對應 確認 .aspx 對應至 aspnet_isapi.dll 2.0 版本(C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll)。
  3. 回到虛擬目錄內容,點擊 目錄安全性 → 驗證與存取控制 → 編輯。
  4. 在 權限 區域,確保下列帳戶具備 讀取/寫入 權限:
    • ASPNET(1.1 相容)
    • IWAM_<MachineName>
    • Local Service
    • Network Service
    • System
    • Administrators
  5. 若使用應用程式集區,將集區身分識別設為 NetworkService 或自訂具備權限的網域帳戶。
  6. 執行 iisreset 重啟 IIS。

替代方案:aspnet_regiis 修復對應

若上述無效,執行指令重新註冊 ASP.NET 2.0 ISAPI:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

參數說明:-i 安裝 ASP.NET ISAPI 對應並更新腳本對應;-r 僅更新腳本對應;-u 移除。

驗證修復

瀏覽網站首頁,確認不再出現錯誤。若仍有問題,檢查事件檢視器最新記錄,並確認 Web.config 無語法錯誤、<processModel> 設定正確。

預防建議

  • 生產環境安裝 .NET 新版本前,先備份 IIS 設定(%windir%\system32\inetsrv\MetaBase.xml)。
  • 使用獨立應用程式集區隔離不同 .NET 版本網站。
  • 定期檢查 NTFS 權限是否包含 Network Service、IIS_IUSRS(IIS 7+)。
  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved