405 Error : Method Not Allowed

  Print
Issue
You have a .net core application but are receiving messages such as:
+ 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

Cause
WebDAV module throws 405. The reason why WebDAV throws 405 is that it claims to process the request, but site is not configured to process it.

Resolution
Modify / create your web.config to remove the handlers and modules for webDAV

Example:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- To customize the asp.net core module uncomment and edit the following section.
For more info see https://go.microsoft.com/fwlink/?linkid=838655 -->
<system.webServer>
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="aspNetCore" />
<remove name="WebDAV" />
<!-- I removed the following handlers too, but these
can probably be ignored for most installations -->
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />

<add name="aspNetCore"
path="*"
verb="*"
modules="AspNetCoreModule"
resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%"
arguments="%LAUNCHER_ARGS%"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>



Related Articles

Login

 
Forgot password?
Register now

Language