2017-08-23 66 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 
相關問題