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