I have an MVC4 project with language selection:
1 main part with:
In my case, I was rendering another action method for my menu section in _layout.cshtml file using @Html.Action("Menu", "Menu") whereas I forgot to create Menu controller and as layout file was being used in my current controller action's view therefore I was getting this error in my current action render request. try to look in your layout and as well as view file if you did the same mistake
In my case namespaces
parameter was not matching the namespace of the controller.
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Admin_default",
"Admin/{controller}/{action}/{id}",
new {controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new[] { "Web.Areas.Admin.Controllers" }
);
}
In my case of legacy application, the issue occurred when I added below entry in web.config file under the node <system.webServer>
<modules runAllManagedModulesForAllRequests="true"></modules>
When I removed it, the issue resolved.
In my case, the same error was not related to Area but thought to post the error caused in my case, which may be helpful for the people who come to this thread by searching "The controller for path was not found or does not implement IController"
The error was caused because of wrong entry in _Layout.cshtml file.
@Styles.Render("~/Content/misc")
The bundle with that name was removed in BundleConfig.cs but forgot to remove it in _Layout.cshtml
It was silly, but we programmers always do lot of silly mistakes :)
in my case, the problem was that the controller class has not been publicly announced.
class WorkPlaceController : Controller
the solution was
public class WorkPlaceController : Controller
Also, for those who the solution above didn't work, here's is what worked for me:
I have a solution with multiple projects. All projects were in MVC3. I installed Visual Studio 2012 in my machine and it seems that some projects were automatically upgraded to MVC4.
I got this problem
The controller for path '/etc/etc' was not found or does not implement IController
because the project that handled that route was pointing to MVC4.
I had to manually update their references to use MVC3. You can also do that by opening the .csproj file with a text editor. Find the reference to MVC3 and remove this line:
<SpecificVersion>False</SpecificVersion>