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:
Allow verb filtering = False
aspNetCore
, WebDAV
and ExtensionlessUrlHandler-Integrated-4.0
None of the above steps have resolved our problem.
Any advice/direction would be much appreciated.
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.
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.
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.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With