IIS / .Net 6 / AspNetCoreV2 / 405 Method Not Allowed

Brandon Hendricks 1 Reputation point
2022-05-19T20:55:04.68+00:00

I am developing a REST API using Web API with .Net 6. My server is Windows 2012 R2 / IIS 8.
GET, POST, and PUT work without issue. When attempting DELETE, I get a 405 Method Not Allowed. I did failed request tracing and can confirm the issue is happening with the AspNetCoreModuleV2.
After doing a lot of searching and trying possible solutions: WebDAV is not installed on the system. I have tried selecting "All verbs" and as well as adding each individual verb in the Handler Mapping section.
Any other suggestions on getting DELETE to work?

Internet Information Services
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,189 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sam Wu-MSFT 7,036 Reputation points Microsoft Vendor
    2022-05-20T02:33:14.493+00:00

    @Brandon Hendricks

    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.

    203914-1.png


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.