.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>
相关推荐
van久1 天前
.Net Core 学习:Razor Pages中 HTML 表头字段的两种写法对比
学习·html·.netcore
武藤一雄1 天前
C# 万字拆解线程间通讯?
后端·微软·c#·.net·.netcore·多线程
武藤一雄3 天前
.NET中到底什么是SignalR (持续更新)
后端·微软·c#·asp.net·.net·.netcore·signalr
by__csdn3 天前
第二章 (.NET Core环境搭建)第二节( Visual Studio Code)
ide·vscode·c#·vue·asp.net·.net·.netcore
by__csdn3 天前
第二章 (.NET Core环境搭建)第三节( Visual Studio for Mac)
ide·kubernetes·c#·asp.net·.net·.netcore·visual studio
武藤一雄4 天前
C#:进程/线程/多线程/AppDomain详解
后端·微软·c#·asp.net·.net·wpf·.netcore
武藤一雄4 天前
C#:Linq大赏
windows·后端·microsoft·c#·.net·.netcore·linq
by__csdn5 天前
第一章 (ASP.NET Core入门)第三节( 认识.NET Standard)
后端·c#·asp.net·.net·.netcore·f#·vb.net
by__csdn5 天前
第一章 (ASP.NET Core入门)第一节( 认识.NET Core)
后端·c#·asp.net·.net·.netcore·f#·vb.net
by__csdn5 天前
第一章 (ASP.NET Core入门)第二节( 认识ASP.NET Core)
数据库·后端·c#·asp.net·.net·.netcore·f#