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的問題。網上搜索找不到明確解答,只好重新部署,查看過程中有何錯誤。部署后訪問出現如下提示:
在iis7的web.config有這個么一個節點
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
將以下內容加到上面節點里就可以了
<add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax" />