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)