The Web server is configured to not list the contents of this directory.

时间:2021-10-11 05:07:38

部署一个ASP.NET MVC网站至一个全新的服务器Windows Server 2008 R2, 数据为MS SQL Server 2014 64bit Expression版本。

运行时,它第一次显示出来是一个异常:

The Web server is configured to not list the contents of this directory.

The Web server is configured to not list the contents of this directory.

解决方法:
打开站点根目录下的Web.config,添加下面节点信息:

<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>