I am trying to host a MVC2 website to IIS.
Steps I have followed:
- Create a Website in IIS ( define directory defined physical path and app pool)
- Published code from visual studio to the physical path.
But when I tried to browse my site it was giving me error
HTTP Error 403.14 - Forbidden The Web server is configured to not list
the contents of this directory.
So, I enabled Directory Browsing feature, Now it only shows directory listing.
What I have tried?
- Added wildcard script map for aspnet_isapi.dll
- enabled HTTP Redirection
and some other things that I have found on some answers related to this question but nothing worked for me.
My routing configurations are
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterRoutes(RouteTable.Routes);
}
}
Here are the things you might check:
- If your application is using ASP.NET 4 ensure that this is registered in IIS. The following command should register it using the
aspnet_regiis.exe
tool: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis -
ir
(adapt the paths with the proper version of the framework if necessary).
- Ensure that the application pool which is configured for the website is using Integrated pipeline mode.
have you found a solution?
I've been facing the same issue for hours. Here is my strange story.
I was configuring a fresh win srv 2008 R2 with IIS installed through role (7.5....) and Added the same components I have in my dev environment's IIS.
I thought that my system had got .net fw 4.0 because I've been able to crate asp.net 4.0 app pools, maybe because I had already had the 4.5 installed. I had also checked the asp.net installed versions on IIS through aspnet_regiis.exe -lv and my ASP.NET v.4.0.... was magically there in both 32 and 64 bit versions.
but...
I noticed something strange watching at the Default Web Site structure: I had only the aspnet_client\system_web\2_0_50707 folder. So the 4.0.... folder was missing.
My solution.
I've uninstalled .net 4.5 from the server, then installed the v.4.0 downloading the package from microsoft. Then I've registered my aspnet 4.0 version using the aspnet_regiis -i present in its folder (%windir%\Microsoft.NET\Framework64\v4.0.30319).
After reinstalling my mvc3/razor web app, everything worked fine, even without installing mvc3 components on the server.
Morale, ensure that you have the fw version of your choice really installed in the system and configured in iis (aspnet).
Hope this helps.
Ciao.