诊断 IIS 7 和 ASP.NET MVC 上的 404 错误 [英] Diagnosing 404 errors on IIS 7 and ASP.NET MVC

查看:35
本文介绍了诊断 IIS 7 和 ASP.NET MVC 上的 404 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 Cassini 开发和测试的 mvc 应用程序.在 GoDaddy 上部署到我的网站,并且默认页面显示正常.点击登录,我得到一个 404.

I have an mvc app developed and tested with Cassini. Deployed to my site on GoDaddy, and the default page comes up fine. Click to log in, and I get a 404.

我在那里运行 IIS 7,所以这是出乎意料的.我的路线很简单:

I'm running under IIS 7 there, so this is unexpected. My routes are pretty plain:

        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            "Default",                                              
            "{controller}/{action}/{id}",                           
            new { controller = "Public", action = "Index", id = "" } 
        );
        routes.MapRoute(
            "Report1",
            "Report/{action}/{start}/{end}",
            new { controller = "Report", action = "Index" }
        );
        routes.MapRoute(
            "Report2",
            "Report/{action}/{start}/{end}/{idList}",
            new { controller = "Report", action = "Index" }
        );

知道可能发生了什么或我如何解决这个问题吗?

Any idea what might be going on or how I can troubleshoot this?

推荐答案

您是否在 IIS7 集成模式下运行?

Are you running in IIS7 integrated mode?

IIS7 的经典模式不会自动将无扩展名的 URL 映射到 ASP.NET(很像 IIS6).

Classic mode of IIS7 does not automatically map extensionless URLs to ASP.NET (much like IIS6).

还要确保您的 Web.config 标签配置正确.

Also make sure your Web.config <system.webServer> tag is configured correctly.

这篇关于诊断 IIS 7 和 ASP.NET MVC 上的 404 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆