2010-04-04 50 views
3

正如Phil Haack在他的博客文章中解釋的那樣,Route Debugger可以幫助您查看路由表。然而
我的網站得到它的路由通過(使用Unity)的MVCTurbine依賴注入,像這樣注入:注入路由註冊時,在哪裏調用RouteDebugger.RewriteRoutesForTesting()?

public class DefaultRoutRegistration : IRouteRegistrator 
{ 
    public void Register(RouteCollection routes) 
    { 
     routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 

     routes.MapRoute(
      "Accounts", 
      "Accounts/{userName}/{action}", 
      new { controller = "Account", action = "Index" } 
      ); 

     routes.MapRoute(
      "Default",            // Route name 
      "{controller}/{action}/{id}",       // URL with parameters 
      new { controller = "Home", action = "Index", id = "" } // Parameter defaults 
      ); 
     RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes); 
    } 
} 

確切位置在哪裏我可以在該RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes)拋出;重寫我的路由表?

+0

仙=(沒有找到問題的愛.. – 2010-04-07 16:47:59

回答

0

對不起鮑里斯,但我沒有通知何時在StackOverflow上詢問渦輪機標籤的問題。 :(

是的,這是正確的地方把RouteDebug件。

+0

無汗:)感謝您的答覆。 嗯,它沒有回來上班那麼我將在家中檢查並在必要時進行更新。 – 2010-07-16 08:20:16