[英]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. 我刚刚创建了一个ASP.NET MVC项目,并且能够使用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. 当我尝试从Visual Studio Development Server更改为项目属性Web-> Server下的本地IIS(IIS 5.1)时。 I am able to browse to the default page, but when I browse to any other page I get a 404 error.
我能够浏览到默认页面,但是当我浏览到其他页面时,出现404错误。
The root of my site and virtual directory is http://localhost/MyMvcApplication 我的网站和虚拟目录的根目录是http:// localhost / MyMvcApplication
Is there a different configuration when using IIS? 使用IIS时是否有其他配置?
You have to setup wildcard mapping to the aspnet_isapi.dll (IIS site configuration). 您必须设置通配符映射到aspnet_isapi.dll(IIS站点配置)。 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).
这意味着对服务器的每个请求都由.NET DLL解析,以便可以重写URL(MVC严重依赖于URL重写)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.