Search code examples
asp.net-mvct4mvc

T4MVC MapRoute doesn't work?


I am trying to setup index page route. It works this way:

routes.MapRoute("", "", new {controller = "Home", action = "Index"})

but if I replace it with T4MVC:

routes.MapRoute("", "", MVC.Home.Index());

somehow it doesn't work (I get a "The resource can not be found" error). Seems like I did it millions of times and it worked. So what am I doing wrong?

Update.

I used Route Debugger and found out the difference between ASP.NET MVC route and T4MVC route is that T4MVC adds Area="" while ASP.NET MVC doesn't (it keeps only controller and action).


Solution

  • The problem was caused with some problems with assemblybindings. I looked through Warnings in VS, pressed twice on the warning about assemblybindings and they were fixed. This question helped me a lot: T4MVC ArgumentOutOfRangeException in View