目前,我的Global.asax.cs
文件中有以下例程:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Arrangement", action = "Index", id = "" }
);
}
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
// Debugs the routes with Phil Haacks routing debugger (link below)
RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);
}
当我点击F5
时,应用程序就会启动,除非我在~/Views/Home/
文件夹中有一个名为Index.aspx
的视图,否则我会收到"View missing“错误消息,尽管我已经重新定义了默认路由并删除了HomeController
。我希望得到路由调试器,如果没有,至少会有一个~/Views/Arrangement/Index.aspx
请求。
RegisterRoutes(Routetable.Routes);
上的断点在调试时永远不会命中。
我尝试过构建、重建、重启VS、清理、重新重建等等,但似乎都不起作用。为什么应用程序不运行当前版本的代码?
https://stackoverflow.com/questions/967813
复制相似问题