Hi guys,
As promised we did dig into the problem.
The real problem is not that easy to explain but we will give our best.
Problem:
In short it is related to how MVC works and partly to the plugin framework in nopCommerce.
When a new plugin is dropped in the Plugins folder and is installed into nopCommerce, even if the plugin has registered routes for its controllers, these routes will not be working as the MVC framework couldn't find the new controller types and couldn't instantiate the requested controller. That's why you get these nasty errors i.e "Controller does not implement IController" or even a more descriptive one "We're sorry, there is no Web page matching your request".
So here is what is actually going on.
1. When you start your nopCommerce application the MVC framework cashes all controller names in a file located in your ASP.NET Temporary folder. The location may differ but you can check in one of these locations:
C:\Users\<User Name>\AppData\Local\Temp\Temporary ASP.NET Files\root
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\
In the root folder there will be many other folders with fancy names like 03b0be9d or 54c3dd3a but you need to order them by date modified and open the latest one (this should be the one of your currently running application). Inside it there will be another folder with similar name and you need to open it as well. Now in the UserCache folder you will see a file MVC-ControllerTypeCache.xml.
This file contains all MVC registered assemblies and controllers in them and is used by MVC to resolve controller names.
On my machine the location looks like this (I use IIS Express):
C:\Users\<UserName>\AppData\Local\Temp\Temporary ASP.NET Files\root\54c3dd3a\99892c19\UserCache\MVC-ControllerTypeCache.xml
2. Now if you drop your new plugins to the Plugins folder and install them, you will notice that the newly installed plugin assembly and controllers are missing in the MVC-ControllerTypeCache.xml file.
That’s why MVC couldn't instatiate your controllers and you get these errors.
Note: Even manually restarting your web server(application) doesn't help this .xml file to be updated!
Solution:
It looks like forcing a kind of a restart(recompiling) of the application will lead to updating the MVC-ControllerTypeCache.xml file with the latest plugins installed.
There are many ways to force a restart(recompiling) in your web application as the ASP.NET engine watches for changes in several places i.e the bin folder of the application. But the simplest and easiest way is just to make a small change in the Global.asax file.
You can do this by opening the file in Notepad and simply add a blank space at the end of the file and then save it.
The Global.asax file is located in the main folder of your application(the same folder where the Web.config file is).
Make sure the Global.asax file has an updated date modified.
You should now be able to open the routes in your plugins.
Hope this helps!