Ana içeriğe atla

Kayıtlar

Kasım, 2017 tarihine ait yayınlar gösteriliyor

Multiple types were found that match the controller named 'Home'. 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.

Bazı durumlarda eğer bir solution altında birden çok proje kullanıyor ve bu projelerde asp.net mvc projesi ile çalışıyor iseniz birden fazla HomeController ınız olur ise aşağıdaki hatayı alabilirsiniz. Multiple types were found that match the controller named 'Home'. 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. Bu durumda sorunu çözmek için yapmanız gereken şey sadece RouteConfig.cs dosyanızda MapRoute işlemine  yeni bir parametre daha ekleyerek kullanılan controller namespace inizi belirtmektir. Örnek olarak aşağıda bold olarak işaretlenmiş kodu inceleyebilir ve kendi projenizde sadece ilgili satırı ekleyebilir, problemi çözebilirsiniz.  public static void RegisterRoutes(RouteCollection rou