.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 天前
C# 特性(Attribute)
c#·.net·.netcore
淡海水2 天前
10-01-互操作-C#与C++边界的内存管理
unity·c#·游戏引擎·.netcore·gc
1-1=02 天前
C# 反射
c#·.net·.netcore
1-1=03 天前
C# 泛型
c#·.net·.netcore
淡海水5 天前
09-01-内存-Unity资源生命周期全景
unity·c#·游戏引擎·.netcore·gc
1-1=05 天前
.NET Core 编译技术
.net·.netcore
1-1=06 天前
.NET Core 文件系统
.net·.netcore·1024程序员节
1-1=07 天前
.NET Core 内存管理
.net·.netcore
1-1=07 天前
.NET Core 配置与选项
.net·.netcore·1024程序员节
淡海水9 天前
08-02-优化-LINQ与函数式编程的GC代价
unity·c#·.netcore·linq·gc