Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Core with IIS - HTTP Verb Not Allowed

We have an ASP.NET Core 2.0 web site that also presents a couple of simple Web API methods for UI enhancement purposes.

The Web API calls work as expected when running locally under IIS Express, but when we deploy to our IIS 8.5 production web server, we get the following error when making HTTP DELETE and PUT requests...

405 Method Not Allowed 

After some web searching, we have found several posts suggesting the removal of the IIS WebDAV module. We have disabled this in IIS (it is our server), and we have also tried the following:

  • Disabled WebDAV
  • Enabled WebDev and set Allow verb filtering = False
  • Set the Hander Mappings to allow All Verbs in the Request Restrictions settings for: aspNetCore, WebDAV and ExtensionlessUrlHandler-Integrated-4.0

None of the above steps have resolved our problem.

Any advice/direction would be much appreciated.

like image 879
Neilski Avatar asked Jan 10 '18 13:01

Neilski


People also ask

How do you fix 405 HTTP verb used to access this page is not allowed?

On the Request Filtering page, switch to the "HTTP Verbs" tab - if you see that "DELETE" has "Allowed" set to False, this is the cause. Remove this entry or changing it to explicitly be allowed will fix the issue.

How do I fix 405 method Not Allowed in IIS?

If you don't need to use WebDAV, then the easiest and the best way to fix "405 method not allowed" issue is to remove WebDAV from your system. You can easily get this done in "Turn Windows Features On or Off" simply un-ticking the checkbox.

Is verb not allowed?

In IIS Manager, select the site you wish to allow PUT or DELETE for. Click the "Request Filtering" option. Click the "HTTP Verbs" tab. Click the "Allow Verb..." link in the sidebar.


1 Answers

This was what worked for me (netcore 2.0)

<system.webServer>    <modules runAllManagedModulesForAllRequests="false">      <remove name="WebDAVModule" />    </modules>  </system.webServer>

Found here: https://www.ryadel.com/en/error-405-methods-not-allowed-asp-net-core-put-delete-requests/

like image 181
Manuel Alves Avatar answered Oct 22 '22 02:10

Manuel Alves