http处理程序返回404

时间:2014-02-09 13:22:40

标签: c# asp.net iis-7 httphandler

我有一个在IIS7中运行的asp.net 3.5 Web应用程序,其中.net框架设置为asp.net 2.0,经典模式下的应用程序池。它在共享主机中设置,因此通过Parallels UI设置。

网站运行正常,没有问题,但Http处理程序没有运行,当我尝试访问它时,我得到404.以下是web.config中的设置。

<system.web>
    <httpHandlers>
        <add verb="*" path="css.axd" type="MyNamespace.Class.File, MyNamespace" validate="false"/>
        <remove verb="*" path="*.asmx"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </httpHandlers>
</system.web>

<system.webServer>
    <handlers accessPolicy="Read, Write, Script, Execute">
        <remove name="WebServiceHandlerFactory-Integrated"/>
        <remove name="ScriptHandlerFactory"/>
        <remove name="ScriptHandlerFactoryAppServices"/>
        <remove name="ScriptResource"/>
        <add name="CssHandler" verb="*" path="css.axd" type="MyNamespace.Class.File, MyNamespace" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode"/>
        <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </handlers>
</system.webServer>

我不确定自己哪里出错了,所以会很感激一些指导。

0 个答案:

没有答案