Server 2012 IIS 8 MVC app shows default IIS home page or 403 / 404 errors

Solution 1:

I spent 2 days trying to find a solution to this, and finally did. Wanted to share with the community in case it helps anyone else.

All the articles and forum messages I ran across on the Internet started to mirror each other in one form or another.

One solution talked about making sure you have the right Application Pool configuration, using 4.0 framework and integrated. [x] Confirmed already set correctly.

Another solution extended direction to use "aspnet_regiis -i" or "aspnet_regiis -ir" which doesn't work on Microsoft Server 2012.

Another solution talked about adding the following to the web.config:

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

However, IIS 8 serves up a response to this saying something to the effect those settings are locked from a higher configuration level and can't be used at the Application level. Meh, ok.

I ultimately tracked down an article that lead me to the following page: http://learn.iis.net/page.aspx/1097/iis-80-using-aspnet-35-and-aspnet-45

The solution was to go back to the Microsoft Server 2012 Dashboard and select the "Add Roles" feature. Scroll down to the root "Web Server (IIS)", expand "Web Server", expand "Application Development" and select "ASP.NET 3.5" and "ASP.NET 4.5" and "Install".

What confused me originally was I hadn't expanded "Application Development", but selected IIS and continued. On the next step, "Features", ".NET Framework 4.5 Features" was selected by default so I selected ".NET Framework 3.5 Features" and thought all would be fine.

After installing the selections under "Application Development", the MVC 4.5 Applications work just the way they were designed. I hope this helps anyone who may have become stuck, like I was.