I am doing some work on a project and I am trying to get my development environment working. The project is written in ASP.net MVC 2. I have ASP.net MVC 3 installed. The controllers have been moved to a seperate project that is namespaced ProjectName.Web.Controllers. All of the controllers inherit from System.Web.MVC.Controller. When I try to hit a controller I get the following:
[HttpException]: The controller for path '/controllerName'; was not found or does not implement IController.
If I make a controllers folder in the web project that contains the views, copy all the controllers there and recompile, it works fine.
Finally figured out the problem in revisiting this today. The solution was created on a machine that did not have the latest version of ASP.Net MVC on it. It only had version 2 and worked just fine. My machine has version 3 and didn’t work. Turns out the controller project was referencing the version 3 assembly on my machine and the version 2 on the original machine. The reference looked like the following:
Since the web project is using version 2 of ASP.Net MVC that is why I was getting the error that the controller didn’t implement IController, it was looking for IController in version 2 not version 3.