HTTP 错误 403.14 - Forbidden Web 服务器被配置为不列出此目录的内容。

从网上找了一份代码但是运行一直出错
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果

img

在web.config中加:

<modules runAllManagedModulesForAllRequests="true"/>

详细参考

IIS出现HTTP 错误 403.14 -Forbidden的解决方法
https://jingyan.baidu.com/article/2fb0ba406ddb7041f3ec5f09.html
通过文档搜索,搜索应用主配置文件applicationhost.config,并通过文字搜索,检查文档中的浏览目录选项,确保设置成true,即

<directoryBrowse enabled =“true”/>


```。

在项目配置文件web.config里添加
```html
 <directoryBrowse enabled="true" />


```,放在
```html
<system.webServer></system.webServer>


```标签里。

不太全面,可能需要看代码来排查