I've read numerous blogs, forum questions and answers, including a bunch here on SO, but still can't figure this one out.
I'm trying to learn MVC3 by running a template MVC3 project out of the box, not changing any code, and I get a 404 error.
I try to navigate to http://localhost:<port>/Home
and then http://localhost:<port>/Home/Index
same results.
Literally I haven't changed anything. Here are the steps I took:
- New Project...
- Visual C# > Web > ASP.Net MVC 3 Web Application (give it a name and then press OK)
- Chose "Internet Application" and check "Use HTML5 semantic markup" (OK)
- Hit F5...
And BOOM! 404 with the usual message:
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /
What am I missing?
I tried adding those to the web.config files:
<add key="enableSimpleMembership" value="false" />
OR
<add key="autoFormsAuthentication" value="false" />
to no avail.
My Global.asax.cs has the original routing code:
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 );
}
But still the dreaded 404 when I press F5... Please help! :(