MVC 3 EC2 and windows 2008 R2 getting them to play nicely

I was recently migrating from using windows 2008 on AWS EC2 to using  Windows 2008 R2 when I stumbled across a problem with getting an MVC 3 app to work. I was getting the following error:

“HTTP Error 403.14 – Forbidden

The Web server is configured to not list the contents of this directory”

The EC2 windows 2008 R2 AMI’s have  .NET Framework 4 already installed so no problems there I thought but …

It all depends on the order in which you do things. On Windows 2008 I set up IIS/ ASP.Net  first then downloaded and installed the .NET 4 framework . On the Windows 2008 R2 instance I had  set up IIS / ASP.Net after  .NET 4  ( as it was already installed)  but this meant that the framework is not automatically registered  with IIS on windows 2008 R2 so you need to give it a helping hand by running aspnet_regiis -i. To do this:

Open a comamnd prompt as administrator  then do the following:

cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319

aspnet_regiis -i



  1. Andy · June 17, 2011

    Thanks ! Spent all afternoon trying to figure this out and your’s was the only solution. I was having problems to run ASP.NET MVC 3 with a brand new Win2008 R2 Image on EC2. Executing the aspnet_regiis did the trick.

  2. Jean-Baptiste BINARD (@binardfr) · October 28, 2013

    Thank you very much ! I have exactly this problem.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s