【发布时间】:2013-11-14 09:37:09
【问题描述】:
我在 Global.asax 中有以下代码,在带有 webforms 的网站项目中,而不是 MVC 应用程序:
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("Documents", "documents/{document-id}/", "~/GetDocument.aspx");
}
路由映射在我运行 IIS Express 的开发环境中正常工作,但在生产环境中返回 404 错误。
服务器运行 IIS 7 并具有几乎相同的 web.config 文件。我无法确定 dev web.config 和生产版本之间的任何更改,这可能是原因。
为什么我的路由映射在我的开发环境中有效,但在我的生产环境中无效?
【问题讨论】: