栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > .Net

Net异常:The Web server is configured to not list the contents of this directory.

.Net 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Net异常:The Web server is configured to not list the contents of this directory.

阅文时长| 0.76分钟字数统计| 1231.2字符
主要内容| 1、引言&背景 2、解决方案 3、声明与参考资料
『.Net异常:The Web server is configured to not list the contents of this directory.』
编写人| SCscHero 编写时间| 2022/2/5 PM4:53
文章类型| 系列完成度| 已完成
座右铭每一个伟大的事业,都有一个微不足道的开始。
一、引言&背景   完成度:100% a) 应对问题

在修改了Debug > General > “Open debug launch profies UI” > IIS Express > App URL的设置后。发现原来可用的Swagger路由跳转变得不可用了,把App URL的设置还原后还是不可用。代码没有任何修改,只动过启动URL。

详细异常如下:

HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.

Most likely causes:
A default document is not configured for the requested URL, and directory browsing is not enabled on the server.

Things you can try:
If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists.
Enable directory browsing.
Go to the IIS Express install directory.
Run appcmd set config /section:system.webServer/directoryBrowse /enabled:true to enable directory browsing at the server level.
Run appcmd set config ["SITE_NAME"] /section:system.webServer/directoryBrowse /enabled:true to enable directory browsing at the site level.
Verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file.

Detailed Error Information:
Module	   DirectoryListingModule
Notification	   ExecuteRequestHandler
Handler	   StaticFile
Error Code	   0x00000000
Requested URL	   https://localhost:44345/swagger/
Physical Path	   C:LIST.MeGitCloud ListUFQI_015_SCscBlogMSAPP
Logon Method	   Anonymous
Logon User	   Anonymous

More Information:
This error occurs when a document is not specified in the URL, no default document is specified for the Web site or application, and directory listing is not enabled for the Web site or application. This setting may be disabled on purpose to secure the contents of the server.
View more information "

且会造成一系列连锁异常反应。

b) 应用场景
  • 使用VisualStudio的IDE,且更改过App URL的设置。
  • 使用IIS的启动方式。
二、解决方案   完成度:100%

最终RootCause为VS或IIS的BUG。删除.vs[AppName]configapplicationhost.config文件即可。

三、声明与参考资料   完成度:100%

原创博文,未经许可请勿转载。

如有帮助,欢迎点赞、收藏、关注。如有问题,请评论留言!如需与博主联系的,直接博客私信SCscHero即可。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1023880.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号