.NetCore WebApi接口 DELETE 请求错误405.0 - Method Not Allowed 跨域问题

.NET兼职社区

解决方案:

web.config中添加如下

csharp 复制代码
 <system.webServer>
      <modules runAllManagedModulesForAllRequests="true">
         <remove name="WebDAVModule" />
      </modules>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\Erp.Api.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
   </system.webServer>

只需要把WebDAVModule删除即可

csharp 复制代码
 <modules runAllManagedModulesForAllRequests="true">
         <remove name="WebDAVModule" />
      </modules>
相关推荐
罗马苏丹默罕默德5 天前
Ubuntu下部署.NetCore WebApi的方法
数据库·ubuntu·.netcore
lingxiao168886 天前
WebApi详解+Unity注入--中篇:.net core的WebAPI
unity·c#·.netcore
老龄程序员7 天前
基于OpenIddict6.4.0搭建的授权UI管理界面
.netcore
武藤一雄7 天前
C# 关于多线程如何实现需要注意的问题(持续更新)
windows·后端·microsoft·c#·.net·.netcore·死锁
冰茶_8 天前
WPF路由事件:隧道与冒泡机制解析
学习·c#·.net·wpf·.netcore·mvvm
武藤一雄8 天前
C# 关于GC垃圾回收需要注意的问题(持续更新)
后端·微软·c#·.net·.netcore
武藤一雄8 天前
C# 关于应用程序域(AppDomain)需要注意的问题(持续更新)
后端·microsoft·微软·c#·.net·.netcore
csdn_aspnet12 天前
在 ASP.NET Core 中发布 RabbitMQ 消息
rabbitmq·.netcore
csdn_aspnet13 天前
在 ASP.NET Core 中使用(消费) RabbitMQ 消息
rabbitmq·.netcore
csdn_aspnet14 天前
ASP.NET Core 应用程序中的单点登录 (SSO)
.netcore·sso