I know that Core 2 is moving away from the web.config and towards Json configuration. However, I have come across an issue where by my IIS 7 server has WebDav installed which is blocking HTTP PUT requests to my webapi.
The following link has provided a working solution by removing WebDav;
Remove WebDav Web.Config for Core 1
The issue I am having is that I need to add this to the generated web.config on the server with every publish as it is being over written each time.
Is it possible for me to add a web.config to my Asp.Net Core 2 webapi? or tell it to add this to the one it is generating?
In Asp.Net Core 2.1 I added web.config file into the root of project then remove WebDAV from module and handler
<system.webServer>
<modules runAllManagedModulesForAllRequests="false" xdt:Transform="Insert" >
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV"/>
</handlers>
</system.webServer>
The web.config file is generated when you are publishing the project. It works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With