Error 405 – Methods not allowed in Asp.Net Core application

I developed an Api in Asp.Net Core Web Api. While testing it on my local machine verything works fine. When I deployed it to my Ionos Managed Windows Hosting I got a 405 Http Error on some Endpoints. Analyzing this behaviour showed me that only controller methods with PUT and DELETE annotations throwed the error.

The problem seems to be the WebDav Module of IIS blocking PUT and DELETE requests by default.

Solution: Remove WebDav in the web.config file.


<system.webServer>
<handlers>
<remove name="WebDAV" />
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<modules>
<remove name="WebDAVModule" />
</modules>
</system.webServer>