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

问题描述:

我刚刚创建了一个新的空网站在Visual Studio 2012,并点击运行(即视图浏览器)和我得到这个错误:

I just created a new empty website in Visual Studio 2012 and clicked on run (i.e view in browser) and I get this error :

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

我走进IIS和点击目录浏览,然后确保目录浏览已启用,但我仍然得到这个错误。我无法弄清楚?

I went into IIS and clicked on Directory browsing and then ensured that Directory browsing was enabled but I still get this error. I can't figure it out ?

我刚刚创建的网站项目未在IIS管理器中默认的网站,我觉得很奇怪上市。

The website project I just created is not listed in Default web sites in IIS Manager which I thought was odd.

我要如何摆脱这种错误的?

How do I get rid of this error ?

保持这个到您的网页配置文件然后重命名附加价值=yourwebformname.aspx

keep this into your web config file then rename the 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>