I am trying to host a MVC2 website to IIS. Steps I have followed:
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?
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:
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).