0
我正在將舊應用程序從經典模式遷移到集成模式,並且先前註冊的http處理程序不再有效。我已經放在他們應該去哪裏system.webServer下的處理程序部分,但沒有骰子:傳統到集成模式,http處理程序未運行
<system.webServer>
<handlers>
...
<add name="zip.ashx_*" path="zip.ashx" verb="*" type="SpringAir.Web.ZipDownloadHandler, SpecAndQuote" preCondition="integratedMode,runtimeVersionv2.0" resourceType="Unspecified" />
<add name="file.ashx_*" path="file.ashx" verb="*" type="SpringAir.Web.FileDownloadHandler, SpecAndQuote" preCondition="integratedMode,runtimeVersionv2.0" resourceType="Unspecified" />
<add name="stream.ashx_*" path="stream.ashx" verb="GET" type="SpringAir.Web.StreamDownloadHandler, SpecAndQuote" preCondition="integratedMode,runtimeVersionv2.0" resourceType="Unspecified" />
</handlers>
...
</system.webServer>
但他們總是返回404配置轉儲從
appcmd list config "Default Web Site/MyApp" -section:system.webServer/handlers
顯示處理器正確:
<system.webServer>
<handlers accessPolicy="Read, Script">
...
<add name="zip.ashx_*" path="zip.ashx" verb="*" type="SpringAir.Web.ZipDownloadHandler, SpecAndQuote" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="file.ashx_*" path="file.ashx" verb="*" type="SpringAir.Web.FileDownloadHandler, SpecAndQuote" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="stream.ashx_*" path="stream.ashx" verb="GET" type="SpringAir.Web.StreamDownloadHandler, SpecAndQuote" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv2.0" />
...
如果我從stream.ashx切換到註冊的處理程序路徑stream.foo,我還是得到了404,但錯誤頁面是不同的。對於stream.ashx,它看起來爲like this,對於stream.foo它看起來爲like this。
也許stream.ashx實際上是觸發* .ashx處理程序,然後查找名爲stream.ashx的文件,但找不到一個。我真的不知道其他處理程序發生了什麼,因爲我的配置看起來是正確的。任何建議,將不勝感激。
你看到在事件查看器IIS什麼? –
Windows事件查看器中沒有任何內容,並且inetpub下的IIS日誌只記錄URL和404返回的內容。從VS啓動的IIS express也會發生完全相同的行爲,所以至少這是一致的。現在我已經通過每個處理程序的路由了,我手動返回HttpHandler的一個實例,但我仍然想知道這裏發生了什麼。 – naasking