1
votes

In VS2013 project settings I changed my ASP.NET Web API application to run in IIS from IIS EXPRESS on the same computer. It worked in IIS Express but I can't get it to run in IIS without this error about ExtensionlessUrlHandler-Integrated-4.0 and An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

I have tried everything in the posts below but nothing works to stop this error except changing the app pool to from Integrated to Classic. That option doesn't work either because brings more errors.

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

I'm using VS 2013, ASP.NET 4.5.1, IIS 7.5, and it's running on Windows Server 2008 R2 Standard

This is my web.config system.web and webserver sections

<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>

This is the error returned

Server Error in Application "DEFAULT WEB SITE"
Internet Information Services 7.5
Error Summary 
HTTP Error 500.24 - Internal Server Error

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

Detailed Error Information 
ModuleConfigurationValidationModule NotificationBeginRequest HandlerExtensionlessUrlHandler-Integrated-4.0 
Error Code0x80070032 
Requested URL http://localhost:80/Token 
Physical Path C:\inetpub\wwwroot\Token 
Logon Method Not yet determined 
Logon User Not yet determined 
Failed Request 

Tracing Log Directory C:\inetpub\logs\FailedReqLogFiles 
Most likely causes: system.web/identity@impersonate is set to true.

Things you can try: If the application supports it, disable client impersonation.
If you are certain that it is OK to ignore this error, it can 
be disabled by setting system.webServer/validation@validateIntegratedModeConfiguration to false.

Move this application to an application pool using Classic .NET mode 
- for example, %SystemRoot%\system32\inetsrv\appcmd set app "Default Web Site/" /applicationPool:"Classic .NET AppPool"

(You can set "Classic .NET AppPool" to the name of another application pool running in Classic managed pipeline mode) 
1

1 Answers

2
votes

The information in the links in my question worked. Specifically

<validation validateIntegratedModeConfiguration="false" />

this

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

and this

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

I also opened the Configuration Editor in IIS for the site and changed the validateIntegratedModeConfiguration and runManagedModulesForWebDAVRequests to false

There was something else going on that was keeping me from knowing this was working. I am using ASP.NET Web API membership to authenticate using individual accounts and when I call the /Token to login it was going to root website and my application was in a virtual directory. When that call was made it was raising the Integrated managed pipeline mode error. I created a new site in IIS for the application instead of using a virtual directory. There might be a way get it to work while using the virtual directory but this was on way to do it.