.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>
相关推荐
睡前要喝豆奶粉10 小时前
多表分页联查——EF Core方式和Dapper方式
c#·.netcore
csdn_aspnet18 小时前
.NETCore、.NET 7 和 RabbitMQ 的发布-订阅模式
rabbitmq·.netcore·.net7.
爱吃香蕉的阿豪19 小时前
深入理解 .NET Core 中的 IServiceScopeFactory:用法、场景与静态类依赖注入
.netcore
sky-stars2 天前
.NET 泛型编程(泛型类、泛型方法、泛型接口、泛型委托、泛型约束)
c#·.net·.netcore
The Sheep 20232 天前
.NetCoreMVC 开发网页使用sass
.netcore·sass
宝桥南山3 天前
.NET10 - 尝试一下Blazor Web Assembly Standalone App的fingerprint新特性
microsoft·微软·c#·asp.net·.net·.netcore
刚子编程5 天前
ASP.NET Core Blazor 核心功能一:Blazor依赖注入与状态管理指南
开发语言·.netcore·blazor
是萝卜干呀5 天前
Backend - HTTP请求的常用返回类型(asp .net core MVC)
http·c#·.netcore·iactionresult
精神小伙就是猛5 天前
.Net Core基于EasyCore.EventBus实现事件总线
微服务·.netcore
sky-stars7 天前
Visual Studio 2022 安装使用:Entity Framework Core
asp.net·.netcore·visual studio