I'm running Windows 7 Ultimate (64 bit) using Visual Studio 2010 RC. I recently decided to have VS run/debug my apps on IIS rather than the dev server that comes with it.

However, every time I try to run an MVC app, I get the following error:

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

Error Information

Module DirectoryListingModule

Notification ExecuteRequestHandler

Handler StaticFile Error

Code 0x00000000 Requested

URL http://localhost:80/mySite/

Physical Path C:\myProject\mySite\

Logon Method Anonymous Logon

User Anonymous

I placed a default.aspx file in the directory and I received the following error:

HTTP Error 500.21 - Internal Server Error Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

Are there any other steps I forgot to take to get this working?

Notes: I installed IIS 7.5 after installing VS 2010 RC. I used the built-in "Create Virtual Directory" button under the "Web" tab in the MVC project's "Properties" in Visual Studio 2010. I made sure that the application is using the ASP.NET 4 App Pool.

Below are the installed features of IIS I have.

alt text

2/6/2011 6:52:31 AM

Accepted Answer

ASP.NET 4 was not registered in IIS. Had to run the following command in the command line/run

32bit (x86) Windows

%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir

64bit (x64) Windows

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir

Note from David Murdoch's comment:

That the .net version has changed since this Answer was posted. Check which version of the framework is in the %windir%\Microsoft.NET\Framework64 directory and change the command accordingly before running (it is currently v4.0.30319)

9/5/2011 6:20:34 AM

Make sure you have is the following set in your web.config:

    <modules runAllManagedModulesForAllRequests="true"/> 

Better solution:

Even though above solution works absolutely fine, it can cause other problem as it runs all your registered HTTP modules on every request (even on every request of .jpg .gif .css .html .pdf etc) and it is obviously waste of resource. Instead

  <remove name="UrlRoutingModule-4.0"/>
  <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" preCondition="" />

Make sure preCondition attribute is empty means it will run on all requests. [Read more](,"Read original post")


Another reason why someone might get this error is if the file Global.asax is not in the root folder anymore.


I was also receiving this error and discovered that "HTTP Redirection" was not turned on in Windows Server. This blog post points this out as well:


Sweet Jesus. I tried all of the above things (but found my settings identical). YET ANOTHER SOLUTION if you are having issues:

Try installing this KB for your system. If you are seeing 404s it might be because you don't have this update -- and the isapi module just isn't getting found and there's not a lot you can do about that without this!


Also u can switch AppPool to Integrated mode. Thnx to Michael Bianchi (, I only want to underline that.


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Email: [email protected]