0

on one pc i got the problem that asp web api doesn't accept http verbs like PUT and DELETE.

I removed webdav via webconfig

and my config looks liek this

 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <handlers>
      <remove name="WebDAV" />
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <remove name="OPTIONSVerbHandler" />
      <remove name="TRACEVerbHandler" />

      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
  </system.webServer>

I IIS i deactivated filtering options of webdav for the given site

When I add

<add name="WebDAV" path="*" verb="*" modules="WebDAVModule"
     resourceType="Unspecified" requireAccess="None" />

then the methods are allowed but from there on i can't attach a debugger to this api site with the "Method not allowed" eror.

enter image description here

Controller Method is defined like this:

[HttpDelete]
[Authorize]
[Route("api/projects/{id:guid}")]
public async Task<IHttpActionResult> Delete(Guid id)
{

can anyone point out what I'm doing wrong?

Boas Enkler
  • 12,264
  • 16
  • 69
  • 143

0 Answers0