.NetCore 网站DELETE请求错误405.0 - Method Not Allowed 因为使用了无效方法

时间:2023-03-08 18:36:59
.NetCore 网站DELETE请求错误405.0 - Method Not Allowed 因为使用了无效方法

.netCore网站Delete请求405错误

.NetCore 网站DELETE请求错误405.0 - Method Not Allowed 因为使用了无效方法

解决方案

1:在启用或关闭Windows功能 –> Internet Information Services 关闭WebDAV发布(这种方式可能会影响其他需要WebDav的网站)

.NetCore 网站DELETE请求错误405.0 - Method Not Allowed 因为使用了无效方法

2:修改当前Asp.Net Core 发布后的WebConfig(不去卸载WebDav,通过修改配置文件只解决当前项目的问题)

去除WebDAVModule,

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

.NetCore 网站DELETE请求错误405.0 - Method Not Allowed 因为使用了无效方法

参考:

https://www.cnblogs.com/tianma3798/p/9109215.html