在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
An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode
我使用Classic
,VS 2013
,ASP.NET 4.5.1
,并在IIS 7.5
这是我的Windows Server 2008 R2 Standard
web.config
和system.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>
答案 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
,并将validateIntegratedModeConfiguration
和runManagedModulesForWebDAVRequests
更改为false
还有其他事情让我不知道这是有效的。我正在使用ASP.NET Web API membership to authenticate using individual accounts,当我调用/Token
登录时,它将转到root网站,我的应用程序位于虚拟目录中。在进行该调用时,它正在提升Integrated managed pipeline mode error
。我在IIS中为应用程序创建了一个新站点,而不是使用虚拟目录。可能有一种方法可以在使用虚拟目录时使其工作,但是这样做就可以了。