1.安装
在程序包控制台中执行命令
PM> Install-Package routedebugger
安装成功后Web.config文件中会自动加入行
<add key="RouteDebugger:Enabled" value="true" />
2.使用
在文件Global.asax中 Application_Start() 中添加代码 PreApplicationStart.Start();
如下样式:
protected void Application_Start() {
RegisterRoutes(RouteTable.Routes);
PreApplicationStart.Start();
//.......
}
RegisterRoutes(RouteTable.Routes);
PreApplicationStart.Start();
//.......
}
3.禁用
web.config中
<add key="RouteDebugger:Enabled" value="true" />
改为
<add key="RouteDebugger:Enabled" value="false" />