0

I'm trying to deploy MVC4 on IIS7.5 but i have some issues. I have

  • installed Windows Server 2008 R2
  • installed .NET 4.0
  • installed Web Deployment 64 Tool
  • installed IIS 7.5 role (With ASP.NET and Management Service)
  • i added domain name to .hosts file which point to server ip addresses (development machine)
  • i created web pool with .NET 4.0 support
  • i created web site which point to C:\www\AppName and add that web site to previous AppPool
  • i created C:\www\AppName folder and deploy to that folder MVC4 app (publish method in visual studio project)
  • i started web site
  • i added domain name to IE and im getting this error

HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.

I read some articles and i have by default in Web.Config file this

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" />
  </system.webServer>

I also tried

  <system.webServer>
  <modules>
    <remove name="UrlRoutingModule-4.0" />
    <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
  </modules>
   <validation validateIntegratedModeConfiguration="false" />
</system.webServer>

It gives me same error, however if I remove

 <validation validateIntegratedModeConfiguration="false" />

it gives me this error in both cases

HTTP Error 500.24 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

What i have to do to proper settings ? It is my first MVC4 project and application will be used few times by few users with windows authentication.

EDIT: Solution is to use Virtual Directory. TIP: VS 2010 is able to create and configure Virtual Directory itself. (Project properties > Web > Create Virtual Directory)

Erti-Chris Eelmaa
  • 25,338
  • 6
  • 61
  • 78
Muflix
  • 6,192
  • 17
  • 77
  • 153
  • Have you seen [this question](http://stackoverflow.com/questions/2374957/asp-net-mvc-on-iis-7-5)? – Daniel J.G. Jan 05 '15 at 17:38
  • 2 questions: Can you run and access the pages on your IISExpress(development machine) and can you configure you website to run locally using IIS(on your machine), thirdly can you check IIS errors to see what is happening – Jack M Jan 06 '15 at 17:01
  • I just finished Local IIS 7.5 setting on my Windows 7 and without DB it works fine (DB is my Local and i was not able to connect to it from IIS but it does not matter because it is development only and production is on normal db server) I did it via project properties and let visual studio to create and set virtual directory. When i publish this to IIS Server which i configured as is described in main post it does not work, it throws same errors. But i though that if i will use virtual directory settings from Local IIS it maybe could work. – Muflix Jan 06 '15 at 21:08

1 Answers1

0

Solution is to use Virtual Directory in IIS. If it does not work, let Visual Studio to configure web server itself.

Look on this nice step by step article http://blogs.msdn.com/b/rickandy/archive/2011/04/22/test-you-asp-net-mvc-or-webforms-application-on-iis-7-in-30-seconds.aspx

Muflix
  • 6,192
  • 17
  • 77
  • 153