简体   繁体   English

带有ISP上的ASP.NET MVC路由的404错误

[英]404 Error w/ ASP.NET MVC Routing on ISP

I have a simple ASP.NET MVC 1.0 site w/ Home, Upload, and About links based upon the default project template for an ASP.NET MVC Project. 我有一个简单的ASP.NET MVC 1.0网站,带有“主页”,“上载”和“关于”链接,基于ASP.NET MVC项目的默认项目模板。 The Global.asax.cs has the following route. Global.asax.cs具有以下路由。

  routes.MapRoute(
      "Default",                                              // Route name
      "{controller}/{action}/{id}",                           // URL with parameters
      new { controller = "Home", action = "About", id = "" }  // Parameter defaults
  );

On my local computer the site and links work correctly. 在我的本地计算机上,站点和链接正常运行。 However, when the site is deployed to my ISP (shared hosting) the default Home/About is displayed when the site loads, but clicking any of the links results in a 404 Page not found error. 但是,将站点部署到我的ISP(共享主机)时,在站点加载时会显示默认的“主页/关于”,但是单击任何链接都会导致404页面未找到错误。

I had to include: System.Web.Abstractions System.Web.Mvc System.Web.Routing 我必须包括:System.Web.Abstractions System.Web.Mvc System.Web.Routing

in my /bin folder as MVC 1.0 is not installed in the GAC on the ISP. 在我的/ bin文件夹中,因为ISP上的GAC中未安装MVC 1.0。

Thoughts on why this is not routing correctly? 关于为什么这不能正确路由的想法?

Thanks, Chris 谢谢克里斯

There are routing issues that you need to be aware of when deploying asp.net mvc applications. 部署asp.net mvc应用程序时,需要注意一些路由问题。 What version of IIS is your ISP using? 您的ISP使用什么版本的IIS?

See here: 看这里:

ASP.NET MVC on IIS6 IIS6上的ASP.NET MVC

Basically, if you're using IIS6, you'll need to hack around a bit. 基本上,如果您使用的是IIS6,则需要进行一些修改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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