ExtensionlessUrlHandler-Integrated-4.0和集成管理管道模式错误

时间:2015-07-17 04:35:14

标签: asp.net visual-studio iis

VS2013项目设置中,我将ASP.NET Web API应用程序更改为在同一台计算机上IIS的{​​{1}}中运行。它在IIS EXPRESS中有效,但我无法在IIS Express中运行它而没有关于IIS的错误 ExtensionlessUrlHandler-Integrated-4.0

我已尝试过以下帖子中的所有内容,但除了将应用池更改为An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.Integrated之外,没有任何方法可以阻止此错误。该选项不起作用,因为会带来更多错误。

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode

WebDAV and WebAPI together cause Error: Handler “ExtensionlessUrlHandler-Integrated-4.0” has a bad module “ManagedPipelineHandler” in its module list

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode

Handler “ExtensionlessUrlHandler-Integrated-4.0” has a bad module “ManagedPipelineHandler” in its module list

我使用ClassicVS 2013ASP.NET 4.5.1,并在IIS 7.5

上运行

这是我的Windows Server 2008 R2 Standard web.configsystem.web部分

webserver

这是返回的错误

<system.web>    
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <customErrors mode="Off" />  
</system.web>
<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="false">
        <remove name="WebDAVModule" />
    </modules>
    <handlers>
        <remove name="WebDAV" />
        <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
        <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
        <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
        <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
        <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
        <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
</system.webServer>

1 个答案:

答案 0 :(得分:2)

我的问题链接中的信息有效。具体地

<validation validateIntegratedModeConfiguration="false" />

<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="managedHandler" />

和这个

<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />

我还在IIS中为该网站打开了Configuration Editor,并将validateIntegratedModeConfigurationrunManagedModulesForWebDAVRequests更改为false

还有其他事情让我不知道这是有效的。我正在使用ASP.NET Web API membership to authenticate using individual accounts,当我调用/Token登录时,它将转到root网站,我的应用程序位于虚拟目录中。在进行该调用时,它正在提升Integrated managed pipeline mode error。我在IIS中为应用程序创建了一个新站点,而不是使用虚拟目录。可能有一种方法可以在使用虚拟目录时使其工作,但是这样做就可以了。