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

asp.net MvcIis 8

asp.net Mvc Problem Overview


Running Microsoft Server 2012 RC using Oracle's free VirtualBox Application. Used a Bridged Network adapter type in the VirtualBox settings. Installed AD and DNS, IIS. Under the IIS options, Management Tools, clicked the box for Management Services. This allowed me to use the "Web Deploy" feature in Visual Studio 2012 RC. On the guest OS, I run Windows 7 Ultimate.

I was able to successfully deploy the MVC 4 Application to IIS Default Web Site, but it wasn't displaying. Instead, the default IIS home page was. I disabled the default home page and refreshing the page displayed a 403 page. I tried typing in one of the Views and a 404 page displayed.

asp.net Mvc Solutions


Solution 1 - asp.net Mvc

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.

Solution 2 - asp.net Mvc

I selected ".NET Framework 3.5 Features" and thought all would be fine !!! No other actions have not helped. When this problem appeared "suddenly". For a while everything worked. But after the next publishing the app worked for a few minutes, then went into error 403.14

Solution 3 - asp.net Mvc

All you need is just to change compilation debug mode to true in web config and keep other property same. Open your Publish Folder and open Web Config file.

<configuration> <compilation debug="true"> </compilation> </configuration>

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionHillbilly CoderView Question on Stackoverflow
Solution 1 - asp.net MvcHillbilly CoderView Answer on Stackoverflow
Solution 2 - asp.net MvcClevelusView Answer on Stackoverflow
Solution 3 - asp.net MvcBasit JamilView Answer on Stackoverflow