我目前在我的 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
的视图,否则我会得到“视图丢失”错误消息,尽管我已经重新定义了默认路由并删除了 HomeController
。我希望得到路由调试器,如果没有,至少请求 ~/Views/Arrangement/Index.aspx
。
调试时永远不会碰到 RegisterRoutes(Routetable.Routes);
上的断点。
我试过建造,重建,重启 VS,清理,重建等,但似乎没有工作。为什么应用程序不运行当前版本的代码?