I have a problem loading pages from an MVC5 application.
I have this software installed:
- Windows 10
- Visual Studio Enterprise 2015
- Microsoft IIS 10.0 Express
- MVC 5 with Entity Framework
So far, everything has been working fine and I was able to display the website. After creating the model and after that, the controller using the entity structure received this error message.
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Most likely causes:
A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
Things you can try:
If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists.
Enable directory browsing.
Go to the IIS Express install directory.
Run appcmd set config /section:system.webServer/directoryBrowse /enabled:true to enable directory browsing at the server level.
Run appcmd set config ["SITE_NAME"] /section:system.webServer/directoryBrowse /enabled:true to enable directory browsing at the site level.
Verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file.
Detailed Error Information:
Module DirectoryListingModule
Notification ExecuteRequestHandler
Handler StaticFile
Error Code 0x00000000
Requested URL http://localhost:2063/
Physical Path c:\users\johan\documents\visual studio 2015\Projects\MvcMovie2\MvcMovie2
Logon Method Anonymous
Logon User Anonymous
Request Tracing Directory C:\Users\johan\Documents\IISExpress\TraceLogFiles\MVCMOVIE2
So, first I started with the sentences that the error message gives me.
Both of them worked great.
- cd to the IIS Express installation directory
-appcmd set config /section:system.webServer/directoryBrowse /enabled:true
Then I tried to run this command:
appcmd set config ["SITE_NAME"] /section:system.webServer/directoryBrowse /enabled:true
["SITE_NAME"] :
- ["SITE_NAME"]
- ["localhost"]
- ["MovieDb2"]
- "MovieDb2"
- [MovieDb2]
- MovieDb2
, :
ERROR ( message:Cannot find SITE object with identifier ["SITE_NAME"]
, .ASPX IIS Express.
Visual Studio index.cshtml " "
, .
, IIS. , IIS.
: https://msdn.microsoft.com/nl-nl/library/bb763170.aspx
inetmgr .
Web.config :
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
.
: HTTP 403.14 - - ,
IIS, .
, - .
.