asp.net - HTTP 错误 403.14 - 禁止 - Web 服务器配置为不列出此目录的内容

标签 asp.net iis

我刚刚在 Visual Studio 2012 中创建了一个新的空网站,然后单击“运行”(即在浏览器中查看),然后收到此错误:

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

我进入 IIS 并单击目录浏览,然后确保目录浏览已启用,但我仍然收到此错误。我看不懂?

我刚刚创建的网站项目没有列在 IIS 管理器的默认网站中,我认为这很奇怪。

如何消除这个错误?

最佳答案

将其保留到您的 Web 配置文件中,然后重命名 add value="yourwebformname.aspx"

<system.webServer>
    <defaultDocument>
       <files>
          <add value="insertion.aspx" />
       </files>
    </defaultDocument>
    <directoryBrowse enabled="false" />
</system.webServer>

其他

<system.webServer>
    <directoryBrowse enabled="true" />
</system.webServer>

关于asp.net - HTTP 错误 403.14 - 禁止 - Web 服务器配置为不列出此目录的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18981118/

相关文章:

c# - ASP.NET 在发布到 IIS 后失去与 SQL Server Express 的连接

c# - 如何将本地 IIS 与 .NET Core、C# 6 和 Visual Studio 2015 一起使用?

c# - 存储过程和 XML

JavaScript 代码仅调用一次代码隐藏函数

c# - 必需的数字参数在不包含在 JSON 中时默认为 0

c# - 系统.Data.SqlClient.SqlException : login failed for user '......'

asp.net - 每当重新加载应用程序域时,您如何强制 IIS 应用程序池重新启动?

asp.net - 如何永远不显示黄色错误页面?

javascript - jqgrid 服务器控件的每次回发都会调用 ashx 文件

java - 使用 IIS 7/Tomcat 连接器托管的 Grails 应用程序中的错误页面