.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>
相关推荐
norsd3 天前
Linux CentOS 安装 .net core 3.1
linux·centos·.netcore
时光追逐者5 天前
C#/.NET/.NET Core技术前沿周刊 | 第 50 期(2025年8.11-8.17)
c#·.net·.netcore·.net core
切糕师学AI6 天前
.net core web程序如何设置redis预热?
redis·.netcore
csdn_aspnet7 天前
ASP.NET Core 中的多租户 SaaS 应用程序
.netcore·saas
时光追逐者12 天前
C#/.NET/.NET Core技术前沿周刊 | 第 49 期(2025年8.1-8.10)
c#·.net·.netcore
切糕师学AI12 天前
在 .NET Core 5.0 中启用 Gzip 压缩 Response
.netcore
周杰伦fans13 天前
.NET Core MVC中CSHTML
mvc·.netcore
爱吃香蕉的阿豪20 天前
乐思 AI 智能识别平台(基于 YOLO,.NET+Vue3 开发)开源指南
人工智能·yolo·开源·aigc·.netcore
时光追逐者21 天前
C#/.NET/.NET Core优秀项目和框架2025年7月简报
c#·.net·.netcore
步、步、为营1 个月前
.NET Core 3.1 升级到 .NET 8
microsoft·.net·.netcore