MVC4 Intranet Project template provides a web.config with:
<authentication mode="Windows" />
For some reason unknown to me, just adding the Microsoft ASP.Net Web Pages 2 Nuget Package to a Web App generated from MVC 4 Intranet Project template changes the routing behaviour of the whole application such that /login.aspx becomes the default routing when no controller/action is specified.
This is the defaultUrl default value defined for forms authentication,
see forms-Element definition for details.
The following two bypasses work:
Change Route Map by adding something like
routes.MapRoute(
name: "LoginRedirect",
url: "login.aspx/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
into Route table.
Modify web.config to contain
<authentication mode="Windows">
<forms loginUrl="~/Home/Index" defaultUrl="~/Home/Index"/>
</authentication>
where the forms element provides the proper start page.
Either works. The latter seems more agreeable to me.