Directory listing denied on ASP.Net MVC 4 app running in IIS 6 Virtual Directory

Shane Courtrille picture Shane Courtrille · Mar 8, 2012 · Viewed 13.6k times · Source

I am trying to get ASP.Net MVC 4 working on IIS6 and am running into the always fun Directory Listing Denied error.

Before you start posting about extensionless urls and how I need to read the Haacked blog post.. I have :) So with that out of the way here is the setup:

I have created a new Web Site and configured it to use ASP.Net 4.0. I had to do this because the existing Default Web Site is configured for ASP.Net 2.0 and this breaks extensionless urls. Under the new web site I created a Virtual Directory with Read/Write/Log Vists/Index this resource options selected and execute permissions set to Scripts.

I have verified that ASP.Net v4.0.30319 is in the Web Service Extensions list and is allowed. I have also verified that the .axd mapping is setup correctly in my virtual directories mapping configuration.

I am completely and totally stumped..

As a side bit of trivia I had this working with the web site pointing directly at my ASP.Net 4 web app but we need this to be done via a virtual directory instead. The fact I had this working should mean that the EnableExtensionlessUrl registry setting is not a problem.

Answer

Indomitable picture Indomitable · Mar 27, 2012

I had faced the same problem and it got cleared when I added "Wildcard application mapping" (.*) to aspnet_isapi.dll with unchecked option "Verify that file exists"

Application -> Properties -> Directory -> Configuration -> Mappings -> Insert -> Browse to C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll -> Uncheck "Verify that file exists" -> Ok

Now the site is opening fine without any issues.