12

This applies to ASP.NET in general but also Web API.

How can we handle PUT/DELETE verbs without enabling RAMMFAR (RunAllManagedModulesForAllRequests).

I can't configure the handler mapping within IIS as my site is hosted on an Azure Web Role and any changes I make will not be persisted.

3 Answers 3

19

@Alexander's answer put me on the right track. Had to add the following to get DELETE/PUT handled by ASP.NET:

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="false"/>
    <handlers>
      <remove name="ExtensionlessUrl-Integrated-4.0" />
      <add name="ExtensionlessUrl-Integrated-4.0" 
           path="*." 
           verb="GET,HEAD,POST,DEBUG,DELETE,PUT" 
           type="System.Web.Handlers.TransferRequestHandler" 
           preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
  </system.webServer>
Sign up to request clarification or add additional context in comments.

3 Comments

Please add this: "You can modify the IIS Express "applicationHost.config" in the %userprofile%\documents\IISExpress\config” folder."
I had everything shown above except the <modules> element. When I added that, it started working.
Is this version specific? In IIS 8.0 it causes a 500 Internal Server Error
4

FWIW, we have modified the MVC/Web API project templates to allow all the common HTTP verbs using exactly the mechanism above. The change will be available in the next official drop (which will be RTM). That will it work by default.

1 Comment

I created a new MVC4 app in VS 2012 and copied the settings from the web.config.
2

Already tried to allow the verbs in System.WebServer section in web.config?

Something like this:

<System.WebServer>
     <handlers>
        <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
        <add name="ExtensionlessUrlHandler-Integrated-4.0" 
        path="*." 
        verb="GET,HEAD,POST,DEBUG,PUT,DELETE" 
        modules="IsapiModule" 
        scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" 
        resourceType="Unspecified" 
        requireAccess="Script" 
        preCondition="classicMode,runtimeVersionv4.0,bitness64" 
        responseBufferLimit="0" />
    </handlers>
</System.WebServer>

5 Comments

Unfortunately this does not appear to work - I still get a 404.
Please add this one <remove name="WebDAV" />
That didn't make any difference but your answer did prompt me to look in applicationHost.config. I've posted what ended up working for me.
I never had to do it. I found it in IIS express FAQ learn.iis.net/page.aspx/901/iis-express-faq
Don't see how this would ever work with <handlers></handler>. Typo?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.