Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

ADO.Net data service URL maping interfers with ExtensionlessUrlHandler

$
0
0

IIS handler mapping is making me dizzy although I'm an ASP.Net developer on IIS for about 6 years.

It all began when I was getting 404 errors for my Web API controller methods that were accessed using HTTP PUT and DELETE. This only happened on IIS7 but everything was working fine on IIS Express.

I found many resources that suggest removing WebDAV and adding the following to web.config

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

These lines are added by default to web.config by the Web API Visual Studio project template, and they fix the issue.

Now, when I returned back to IIS Express, I found out that requests to my ADO.Net data service return HTTP 404! and the service doesn't work unless I remove the ExtensionlessUrlHandler-Integrated-4.0 handler mapping.

I found a resource suggesting that the issue can be resolved by mapping a route as follows

routes.IgnoreRoute("{resource}.svc/{*pathInfo}");

But it doesn't.

Why this happens? And how to configure my application to work seamlessly on IIS and IIS Express?


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>