405错误(An unhandled exception occurred while processing the request)

来源:互联网 发布:win10共享设置软件 编辑:程序博客网 时间:2024/05/22 15:46

405错误(An unhandled exception occurred while processing the request)

环境

win7 64、IIS 7.5、Asp.Net Core 2.0

目的

解决 IIS 站点运行,对修改、删除操作执行会报错 405,如下截图

这里写图片描述

解决办法

  • 当前是前后端分离,在前端看到的错误信息如上,查找资料也不好查,如果使用谷歌插件 REST 发起一个删除请求可以看到一个类似页面的源代码,提示内容是405错误。

  • 具体解决办法:

    打开站点配置文件 web.config ,在 <system.webServer> 节点下添加以下代码

    <modules runAllManagedModulesForAllRequests="true" runManagedModulesForWebDavRequests="true"><remove name="WebDAVModule" /></modules>

阅读全文
1 0
原创粉丝点击