I have an empty ASP.NET application and I added an index.html file. I want to set the index.html as default page for the site.
I have tried to right click on the ind
As @vir answered, add routes.IgnoreRoute(""); to RegisterRoutes(RouteCollection routes) which you should find in RouteConfig.cs by default.
Here's what the method could look like:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
The reason is that ASP.NET MVC takes over URL management and by default the routing is such that all extensionless URLs are controlled by the extensionless Url handler defined in web.config.
There's a detailed explanation here.