W mojej aplikacji mam kontroler o nazwie Snippets
zarówno w obszarze domyślnym (w katalogu głównym aplikacji), jak iw moim obszarze o nazwie Manage
. Używam T4MVC i niestandardowych tras, tak:T4MVC i nazwy kontrolerów duplikatów w różnych obszarach
routes.MapRoute(
"Feed",
"feed/",
MVC.Snippets.Rss()
);
i dostaję ten błąd:
Multiple types were found that match the controller named 'snippets'. This can happen if the route that services this request ('{controller}/{action}/{id}/') does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the 'MapRoute' method that takes a 'namespaces' parameter.
The request for 'snippets' has found the following matching controllers: Snippets.Controllers.SnippetsController Snippets.Areas.Manage.Controllers.SnippetsController
Wiem, że istnieją przeciążenia dla MapRoute
że brać namespaces
argumentu, ale nie ma takich przeciążeń z Obsługa T4MVC. Może być, że czegoś brakuje? Ewentualny składnia może być:
routes.MapRoute(
"Feed",
"feed/",
MVC.Snippets.Rss(),
new string[] {"Snippets.Controllers"}
);
lub wydaje się całkiem dobry dla mnie, aby mieć przestrzeń nazw jako własność T4MVC:
routes.MapRoute(
"Feed",
"feed/",
MVC.Snippets.Rss(),
new string[] {MVC.Snippets.Namespace}
);
Z góry dzięki!