.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>
相关推荐
csdn_aspnet18 小时前
在 ASP.NET Core 中使用自定义属性实现 HTTP 请求和响应加密
http·asp.net·.netcore
观无21 小时前
.NET Core + Ocelot 网关 跨域 (CORS) 配置
状态模式·.netcore
csdn_aspnet1 天前
如何在 .NET Core WebAPI 和 Javascript 应用程序中安全地发送/接收密钥参数
javascript·.netcore·cryptojs
武藤一雄3 天前
C# 异步回调与等待机制
前端·microsoft·设计模式·微软·c#·.netcore
武藤一雄4 天前
C#万字详解 栈与托管堆 的底层逻辑
windows·microsoft·c#·.net·.netcore
武藤一雄4 天前
深入拆解.NET内存管理:从GC机制到高性能内存优化
windows·microsoft·c#·.net·wpf·.netcore·内存管理
武藤一雄6 天前
WPF/C# 应对消息洪峰与数据抖动的 8 种“抗压”策略
windows·微软·c#·wpf·.netcore·防抖·鲁棒性
武藤一雄7 天前
C# 竟态条件
microsoft·c#·.net·.netcore
武藤一雄7 天前
WPF深度解析Behavior
windows·c#·.net·wpf·.netcore
不超限7 天前
.net core项目部署至信创环境
.netcore