.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>
相关推荐
1-1=01 天前
ASP.NET Core 自定义容器 和 自定义日志
asp.net·.netcore
1-1=03 天前
ASP.NET Core HTTP 请求管道
.netcore
宝桥南山9 天前
Visual Studio - 记录一个Visual Studio 2026(Insiders)的更新问题
windows·microsoft·微软·.net·.netcore·visual studio
1-1=024 天前
C# 数据结构和特殊类型
数据结构·c#·.net·.netcore
1-1=01 个月前
C# IO和序列化
c#·.net·.netcore
宝桥南山1 个月前
.NET 11 - 尝试一下Blazor中的新特性SupplyParameterFromTempData
microsoft·微软·c#·asp.net·.net·.netcore
1-1=01 个月前
C# 特性(Attribute)
c#·.net·.netcore
淡海水1 个月前
10-01-互操作-C#与C++边界的内存管理
unity·c#·游戏引擎·.netcore·gc
1-1=01 个月前
C# 反射
c#·.net·.netcore
1-1=01 个月前
C# 泛型
c#·.net·.netcore