In meiner Anwendung habe ich Controller namens Snippets
sowohl im Standardbereich (in Anwendungsstamm) und in meinem Bereich Manage
genannt. Ich benutze T4MVC und individuelle Routen, wie folgt aus:T4MVC und doppelte Controller-Namen in verschiedenen Bereichen
routes.MapRoute(
"Feed",
"feed/",
MVC.Snippets.Rss()
);
Und ich bekomme diese Fehlermeldung:
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
Ich weiß, dass es Überlastungen für MapRoute
die namespaces
Argument, aber es gibt keine solche Überlastungen mit T4MVC Unterstützung. Kann mir etwas fehlen? Die mögliche Syntax kann sein:
routes.MapRoute(
"Feed",
"feed/",
MVC.Snippets.Rss(),
new string[] {"Snippets.Controllers"}
);
oder, wie es mir recht gut scheint Namespace als T4MVC Eigenschaft zu haben:
routes.MapRoute(
"Feed",
"feed/",
MVC.Snippets.Rss(),
new string[] {MVC.Snippets.Namespace}
);
Vielen Dank im Voraus!