83

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.

Shog9
  • 156,901
  • 35
  • 231
  • 235
Hillbilly Coder
  • 1,171
  • 1
  • 10
  • 12

3 Answers3

31

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.

Hillbilly Coder
  • 1,171
  • 1
  • 10
  • 12
  • 1
    Apparently this is still biting people - so I've moved your answer into an... Answer. Hope you don't mind... – Shog9 Dec 17 '14 at 01:58
  • Thanks for posting. Now we can add requirement of .NET 4.5.2 into the mix for latest version of Windows server + IIS for MVC 5 apps. Apparently the only way to add is either direct download or via Web Platform installer. Windows Features doesn't have 4.5.2 – sumitkm Apr 12 '15 at 14:34
  • This is still the case today (2017) even after I installed all updates on Windows Server 2012. Thanks! – John Isaiah Carmona Jul 13 '17 at 05:50
0

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

Clevelus
  • 91
  • 1
  • 4
0

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>