Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove WebDav in Startup.cs ASP.NET Core

I published a .NET Core Web API through FTP.

By default, some of the methods weren't working(put and delete), because the server has WebDAV enabled as default.

To remove this, after publishing the application I have to manually go to web.config on FTP and add the following lines

  <modules runAllManagedModulesForAllRequests="false">
    <remove name="WebDAVModule" />
  </modules>

How would one go about it setting it up to be removed automatically - I assume through Startup.cs

like image 807
BroDev Avatar asked Mar 11 '20 16:03

BroDev


People also ask

How to uninstall WebDAV module?

Right click WebDAV and select Remove. Navigate back to the product site. Double-click the Modules item. Right click WebDAVModule and select Remove.


2 Answers

You only need to add web.config file to your API, and then when you publish automatically it will take your web.config.

like image 66
jlmpulido Avatar answered Sep 21 '22 03:09

jlmpulido


You have to remove WebDAVModule from iis server.

Steps:

  1. Go to your site in IIS
  2. Click "Modules"
  3. Remove WebDAVModule
  4. Restart site (might not be needed)

PUT and DELETE requests should now work.

like image 40
Shubham Mondal Avatar answered Sep 23 '22 03:09

Shubham Mondal