2017-08-23 44 views
-1

我有一个项目在IIS上配置。但是当我试图运行然后得到错误asp.net mvc5 HTTP错误403.14 - 禁止Web服务器配置为不列出此目录的内容

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

我试图解决这个错误,我写的代码在web.config的部分。

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

,所以请给该

感谢任何解决方案。

回答

0

发生此问题是因为网站没有启用目录浏览功能,并且未配置默认文档。要解决此问题,请使用下列方法之一: 方法1:在IIS中启用了目录浏览功能(推荐) 要解决此问题,请按照下列步骤操作:

Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK. 
In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify. 
In the Features view, double-click Directory Browsing. 
In the Actions pane, click Enable. 

方法2:添加默认文档 要解决此问题,请按照下列步骤操作:

Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK. 
In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify. 
In the Features view, double-click Default Document. 
In the Actions pane, click Enable. 
In the File Name box, type the name of the default document, and then click OK. 

方法3:在IIS中启用快速 注意目录浏览功能,这种方法对于Web开发人员谁的经验,当他们使用IIS Express中的问题。

为此,请按照下列步骤操作:

Open a command prompt, and then go to the IIS Express folder on your computer. For example, go to the following folder in a command prompt: 

C:\Program Files\IIS Express 

Type the following command, and then press Enter: appcmd set config /section:directoryBrowse /enabled:true 
相关问题