1

Possible Duplicate:
MVC4 HTTP Error 403.14 - Forbidden

Every time I have to configure a ASP.Net mvc application I come across the same error:

HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.

There is a reason this might happen and I have figured it out.

Configured app pool to use LocalSystem account. Added permission for this user in the project folder.

Today another application with this problem and only changing the application pool to use LocalSystem account was not enough. What could I do to solve this problem.

P.S: In Asp Net mvc we do not enable browser directory on IIS so I don´t understand why the problem.

4
  • What url are you sending the request to? Commented Jan 23, 2013 at 20:54
  • @Darin Dimitrov localhost and redirect to "~/Account/Login" Commented Jan 23, 2013 at 20:55
  • 1
    Do not use LocalSystem for an AppPool ID. That is horrible security. Is the .net version correct on the app pool? Commented Jan 23, 2013 at 20:56
  • @Darin Dimitrov Yes... .net4. Should I use create an account with limited privileges and grant the user to the application folder? Commented Jan 23, 2013 at 20:58

1 Answer 1

5

You are seeing this error precisely because you do not allow directory browsing. What this is showing you is that MVC has not picked up on the request and IIS is attempting to find the default document. I have answered a question similar in the past, maybe some of these suggestions will help you discover your problem

Error 403.14 is the HTTP error code for not being allowed to list the contents of a directory. Please be sure that

  • You have setup the website as an application in IIS You have .NET 4.5 installed on the server
  • You have set the application pool to run the proper version of the .NET framework (ie. it is not set to .NET 2.0
  • You are using the integrated pipeline on your application pool .NET
  • 4.5 is actually registered in IIS. Please see this post for a similar issue/resolution Usually, a and d are the biggest issues surrounding MVC deployments to IIS

Also, check your web.config and ensure that this line exists:

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

Update

Well I certainly did not expect this much attention on my answer... With that said, I can expand a little more on the conversation below. DarinD is expressing concern that the

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

is a additional burden on your web server, and he is correct. This line will cause IIS to load all modules for any request, including static files. With that said, given the aspects of IIS 7 such as kernel caching, unless you are hosting a very high traffic site/have tons of modules, then the performance impact will most likely not be noticed by you or your users.

If you want to view a potentially different solution, please check out this blog post for more information on the managedModule line above and you can test if the solution posed there fixes your problems as well.

Lastly, here is a blog post that covers not only the potential performance impacts, but goes deeper into how routing works and what you need to do to get extensionless URLs routing on IIS 6 and 7 (which should cover 7.5 as well)

Sign up to request clarification or add additional context in comments.

8 Comments

I wouldn't recommend setting runAllManagedModulesForAllRequests="true" at all. That would cause all requests, even those to static resources such as javascript, css and images, go through the managed pipeline which obviously comes with a performance overhead.
You shouldn't just parrot another answer on SO. If it is a duplicate question, the question should just be closed.
<system.webServer><modules runAllManagedModulesForAllRequests="true"/> </system.webServer> - Solved my problem. Thanks
Completely agree with @JohnKoerner, things get even even worse when the answer is preaching bad practices such as setting runAllManagedModulesForAllRequests="true".
If this answer is the wrong approach, what's the right approach?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.