1

I am developing an ASP.NET MVC 5 site targeting .NET 4.5.1 and for some reason I am struggling to deploy it on a Windows Server 2008 Standard edition server.

To be clear the site runs fine on my Windows 7 development machine and my Windows Server 2012 test environment but when I deploy it to the Windows Server 2008 in question I get this error:

enter image description here

At this point I tried all the advice about reinstalling ASP.NET and enabling runAllManagedModulesForAllRequests that I found in threads like this one ASP.NET MVC on IIS 7.5 but nothing would make it work.

Eventually I found that I could fix the problem by switching off the "Invoke only requests to ASP.NET applications or managed handlers" option for all managed modules in the application. What this did in essence was to make the following changes to the web.config file:

enter image description here

So my question is two-fold. Firstly, why is this change necessary to get the site to work? Secondly, am I safe to change the web.config permanently given that it will be installed on other servers as well, not all of which will be Windows Server 2008?

Community
  • 1
  • 1
Paul Hunt
  • 3,395
  • 2
  • 24
  • 39
  • Just to confirm. You want user to be able to browse the whole folder `/Main` in the root of your application path? – tweray Aug 05 '14 at 14:19
  • Not browse no, this is an MVC application. The initial error about directory browsing I believe comes up because IIS doesn't know how to execute the application and so tries to browse instead. – Paul Hunt Aug 05 '14 at 14:21
  • Usually this 403 happens if you really have a folder called "Main" in your app root, in this case IIS will get confused and instead of pushing it into CLR, it will take the request as browse directory. Can you first confirm if such "Main" folder exist, and also try hit `/Main/Index` instead of `/Main` to confirm if it is the issue I am talking about. – tweray Aug 05 '14 at 15:17
  • There is no folder called "Main" in the physical folder path of the app. "Main" is just the name of the app. As I've said already the app works perfectly when deployed in exactly the same way to a Windows Server 2012 machine – Paul Hunt Aug 05 '14 at 15:23

0 Answers0