[SOLVED] Blazor Wasm – 405 HTTP verb used is not allowed

Issue

This Content is from Stack Overflow. Question asked by A N

I uploaded a blazor webapp on a host and I get this error while trying to modify or delete a product:
405 – HTTP verb used to access this page is not allowed.
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

It’s something to do with the response headers, they don’t allow the Put or Delete method.
On localhost when testing the webapp everything is fine.
Is it the web host fault or the blazor app?



Solution

This is an IIS error that is typically thrown if WebDav is enabled. This is not a necessary feature for WUG to run in IIS.

You can add these lines to the web.config

<system.webServer>
  <modules>
    <remove name="WebDAVModule" />
  </modules>
  <handlers>
    <remove name="WebDAV" />
  </handlers>
</system.webServer>


This Question was asked in StackOverflow by A N and Answered by S. R. Q. Behbahani It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?