Register HTTP Handlers

今天看了下elfinder,从网上找到了开源代码,打开部署到iis7.5上,运行正常,了解了下基本功能和后台代码,部署时忽略了程序池模式,选择的集成模式,framework 4.0。但项目中用的是经典模式准备迁移进项目时发现问题,换成经典模式显示连接不到后台程序错误,即HTTP Handlers注册未成功,从网上照了N多资料,现记录如下

To register an HTTP handler for IIS 6.0

<configuration>
  <system.web>
    <httpHandlers>
      <add verb="*" path="SampleHandler.new" 
        type="SampleHandler, SampleHandlerAssembly" />
    </httpHandlers>
  </system.web>
</configuration>

To register an HTTP handler for IIS 7.0 running in Classic mode

<configuration>
  <system.web>
    <httpHandlers>
      <add verb="*" path="SampleHandler.new" 
        type="SampleHandler, SampleHandlerAssembly" />
    </httpHandlers>
  </system.web>
  <system.webServer>
    <add name=SampleHandler" verb="*" path="SampleHandler.new" 
      Modules="IsapiModule" 
      scriptProcessor="FrameworkPath\aspnet_isapi.dll"
      resourceType="File" />
  </system.webServer>
</configuration>

To register an HTTP handler for IIS 7.0 running in Integrated Mode

<configuration>
  <system.webServer>
    <handlers>
      <add name="SampleHandler" verb="*" 
        path="SampleHandler.new" 
        type="SampleHandler, SampleHandlerAssembly" 
        resourceType="Unspecified" />
    </handlers>
  </system.webServer>
</configuration>

注:FrameworkPath 在经典模式下必须正确,建议写成:
32位机器 %systemroot%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
64位机器 %systemroot%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
posted @ 2013-08-06 18:42  @宋@  阅读(908)  评论(0编辑  收藏  举报