Geting Error Multiple types were found that match the controller named 'Home' Ask Question
By   Musawar Hussain     30-Dec-2024    1

If you have a controller with the same name (e.g., "HomeController") in different projects and you want to differentiate between them, a straightforward solution is to specify the project name when creating a route map. By doing so, when you run the application, it will clearly identify which project's controller you have selected.

For example, when setting up a route using MapRoute in your route configuration, you can explicitly reference the controller by including the project name. This ensures that the correct controller is associated with the route during runtime. This practice helps avoid ambiguity and ensures that the application correctly identifies and utilizes the desired controller from the specified project.

Example:

namespaces: new string[] { "_360KMall.WebUI.Controllers" } // Newly Added namespaces parameter

Solutions


10393
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM