從MagicAjax到IIS7

來源:互聯網
上載者:User

前幾日伺服器升級,統一將windows server 2003 升級到windows server 2008。相應的IIS也從6.0升級到了7.0,部署以前的服務後訪問發現MagicAjax錯誤:

MagicAjax.MagicAjaxException

The MagicAjax HttpModule is not included in web.config. Add [<httpModules><add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax" /></httpModules>] inside the <system.web> section. 
說明: 執行當前 Web 請求期間,出現未處理的異常。請檢查堆疊追蹤資訊,以瞭解有關該錯誤以及代碼中導致錯誤的出處的詳細資料。 

異常詳細資料: MagicAjax.MagicAjaxException: The MagicAjax HttpModule is not included in web.config. Add [<httpModules><add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax" /></httpModules>] inside the <system.web> section.

源錯誤: 
執行當前 Web 請求期間產生了未處理的異常。可以使用下面的異常堆疊追蹤資訊確定有關異常原因和發生位置的資訊。 

堆疊追蹤: 

[MagicAjaxException: The MagicAjax HttpModule is not included in web.config. Add [<httpModules><add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax" /></httpModules>] inside the <system.web> section.]
   MagicAjax.MagicAjaxContext.get_Current() +125
   MagicAjax.UI.AjaxControl.SetAjaxIntrinsics() +18
   MagicAjax.UI.AjaxControl.OnLoad(EventArgs e) +18
   MagicAjax.UI.Controls.AjaxPanel.OnLoad(EventArgs e) +14
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

________________________________________
版本資訊: Microsoft .NET Framework 版本:2.0.50727.3053; ASP.NET 版本:2.0.50727.3053

尋找web.config檔案,發現,沒有異常,已經按照指示將相應的httpModules放到對應位置,而且在iis6下也沒有問題,這是為什麼呢?可能是IIS7.0的問題。網上搜尋找不到明確解答,只好重新部署,查看過程中有何錯誤。部署後訪問出現如下提示:

 

代碼


應用程式“TTT”中的伺服器錯誤
Internet 資訊服務 7.0
錯誤摘要 
HTTP 錯誤 500.22 - Internal Server Error
檢測到在整合的託管管道模式下不適用的 ASP.NET 設定。
詳細錯誤資訊 
模組    ConfigurationValidationModule
通知    BeginRequest
處理常式    StaticFile
錯誤碼    0x80070032
請求的 URL    http://localhost:81/
實體路徑    E:\TTT
登入方法    尚未確定
登入使用者    尚未確定
最可能的原因: 
•    此應用程式在 system.web/httpModules 節中定義配置。 
可嘗試的操作: 
•    將配置遷移到 system.webServer/modules 節。也可以手動這樣做,或通過在命令列中使用 AppCmd 來這樣做 - 例如,%SystemRoot%\system32\inetsrv\appcmd migrate config "Default Web Site/"。使用 AppCmd 遷移應用程式將使它能夠在整合模式下工作,並能繼續在傳統模式下和以前版本的 IIS 上工作。 
•    如果您確信可以忽略此錯誤,則可以通過將 system.webServer/validation@validateIntegratedModeConfiguration 設定為 false 來禁用它。 
•    也可以將應用程式切換到傳統模式應用程式集區 - 例如,%SystemRoot%\system32\inetsrv\appcmd set app "Default Web Site/" /applicationPool:"Classic .NET AppPool"。只有在無法遷移應用程式時才這樣做。 
(將“Default Web Site”和“Classic .NET AppPool”設定為您的應用程式路徑及應用程式集區名稱) 
連結和更多資訊整合模式是在 IIS 7.0 上運行 ASP.NET 應用程式的首選模式。 

 

執行:%SystemRoot%\system32\inetsrv\appcmd migrate config "TTT/"  問題解決

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.