日期:2014-05-16  浏览次数:20438 次

VS2012 web.config <httpHandlers> 标签设置
VS2012 默认配置文件如下,我添加

<?xml version="1.0" encoding="utf-8"?>

<!--
  有关如何配置 ASP.NET 应用程序的详细信息,请访问
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
    <system.web>
      <httpHandlers>
       <add type="ClassLibraryOT.Class1,ClassLibraryOT" path="info.xml" verb="*"/>
        </httpHandlers>
      
<compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
    </system.web>

</configuration>



运行页面,会报

HTTP 错误 500.23 - Internal Server Error

检测到在集成的托管管道模式下不适用的 ASP.NET 设置。
最可能的原因:
?此应用程序在 system.web/httpHandlers 节中定义配置。


是不是 VS2012 不能直接这样添加httpHandlers
------解决方案--------------------
你这种写法,要在IIS里把你的应用程序池设置成经典模式
------解决方案--------------------
尝试把这句移至<system.webServer><handlers>节点内。