11

I have got a new iis server and from a while i am finding solution for error :

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.

I have seen below solutions:
1.

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


2. IIS Settings http://www.somacon.com/p126.php

Solution 1, causes Internal server error and later unable to find the solution. Solution 2, i am unable to find Property window in iis 8.5, so unable to try the same.

Please help

Divyang Desai
  • 7,483
  • 13
  • 50
  • 76
ArjunArora
  • 986
  • 3
  • 12
  • 27
  • same ? http://stackoverflow.com/questions/3523061/405-http-verb-used-to-access-this-page-is-not-allowed – Aristos Sep 12 '16 at 09:48
  • @Aristos, yes questions is same as mine. Even this question came in my way while searching the answer. I think change in Windows Server Version + IIS 8 creates some confusion while searching the iis settings. Just now i have enabled wcf services from same settings window. – ArjunArora Sep 12 '16 at 12:31
  • To remove a module via web.config, you must both [unlock the module and unlock the section](https://learn.microsoft.com/en-us/aspnet/core/hosting/iis-modules#disabling-iis-modules) in IIS Manager first. – Mark G Apr 21 '17 at 23:41
  • I was having this 405 issue and this solution 1 worked for me on ASP .NET Core 2.1 – Umair Malhi Dec 04 '18 at 17:15

4 Answers4

11

I also had the same internal server error when attempting the first solution, described at HTTP 405 error with Web API. Since I wasn't even using WebDAV, I opted to remove it entirely from IIS (see screenshot below). After a required server restart, the problem was resolved.

Remove WebDAV

Mark G
  • 2,848
  • 1
  • 24
  • 32
3

One of my colleague helped me out. I was missing some of the major iis features.

Goto Add Roles and Features Wizard, then Web Server (IIS)> Web Server > Application Development > Select ASP.net 3.5 and Asp.net 4.5 and click Install.

Goto cmd prompt and iisreset.

For WCF service, Kindly check Http Activation under WCF Services.

Hope this may help you and save your time.

ArjunArora
  • 986
  • 3
  • 12
  • 27
2

This is late but may help some other guys. My application is WEB-API dotnet Core face same problem when deploy on local server resolve this by doing following steps.

<system.webServer>
      <modules runAllManagedModulesForAllRequests="true">
        <remove name="WebDAVModule"/>
        <!-- add this -->
      </modules>
      <handlers>
                <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
                <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
                <remove name="TRACEVerbHandler" />
                <remove name="OPTIONSVerbHandler" />
                <remove name="WebDAV" />
                <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
                <add name="aspNetCore" path="*" verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
                <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*."  verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"  type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" responseBufferLimit="0" />
                <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*."  verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"  modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
                <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*."  verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"  modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
      </handlers>
Ali Imran
  • 646
  • 1
  • 9
  • 26
0

I have faced the same issue with with my PHP application that runs on "Windows server 2019" and IIS server. I tried to test my FHIR APIs through Postman but only POST and GET request were working fine. But PUT requests were not working. Any solutions that were suggested to do on web.config file were not worked for me. Only solution was to remove "WebDAV" module from IIS (as suggested by Mark G). Restarting the server machine is a MUST to apply that feature removal and make my application to work properly.

dds
  • 23
  • 5