Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
asp.net mvc5 HTTP错误403.14-禁止将Web服务器配置为不列出此目录的内容_Asp.net_Asp.net Mvc 5 - Fatal编程技术网

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

asp.net mvc5 HTTP错误403.14-禁止将Web服务器配置为不列出此目录的内容,asp.net,asp.net-mvc-5,Asp.net,Asp.net Mvc 5,我有一个在IIS上配置的项目。但是当我试图运行时,我得到了一个错误 HTTP错误403.14-禁止将Web服务器配置为不列出此目录的内容。 我正在尝试解决这个错误,我在第节的web.config中编写代码 <configuration> <system.webServer> <directoryBrowse enabled="true" /> </system.webServer> </configuration>

我有一个在IIS上配置的项目。但是当我试图运行时,我得到了一个错误

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

我正在尝试解决这个错误,我在第节的web.config中编写代码

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

因此,请给出解决方案


谢谢。

出现此问题的原因是网站未启用目录浏览功能,并且未配置默认文档。要解决此问题,请使用以下方法之一: 方法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.
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.
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
方法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 Directory Browsing.
In the Actions pane, click Enable.
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.
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
方法3:在IIS Express中启用目录浏览功能 注意:此方法适用于在使用IIS Express时遇到问题的web开发人员

要执行此操作,请执行以下步骤:

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.
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.
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