简体   繁体   中英

Getting 404 error with ASP.NET MVC starter project

I just created a ASP.NET MVC project and was able to build and browse it using the Visual Studio Development Server.

When I tried to change from Visual Studio Development Server to my local IIS (IIS 5.1) under the project properties Web -> Server. I am able to browse to the default page, but when I browse to any other page I get a 404 error.

The root of my site and virtual directory is http://localhost/MyMvcApplication

Is there a different configuration when using IIS?

You have to setup wildcard mapping to the aspnet_isapi.dll (IIS site configuration). This means that every request to the server is parsed by the .NET DLL so that URL's can be rewritten (MVC heavily relies on URL rewriting).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM