0
点赞
收藏
分享

微信扫一扫

c# - - - .NetCore 网站请求错误405.0 - Method Not Allowed 因为使用了无效方法

晚安大世界 2024-11-07 阅读 21

参考:https://www.cnblogs.com/clsl/p/11050825.html

修改web.config文件

添加如下代码:

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

修改后的文件总览

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <!--添加内容-->
      <modules runAllManagedModulesForAllRequests="true">
    	<remove name="WebDAVModule" />
      </modules>
      <!--添加内容-->
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath=".\TEST_Service.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: ac173311-426d-4af5-9238-1cd43ae1a935-->
举报

相关推荐

0 条评论