I have Google’d this and tried to find an answer to this error message for weeks.  I got a Error with controller lot of hits from Google but I couldn’t find the definitive answer to correct the error. I’m using Rhino.Commons as part of the application along with Castle project and NHibernate.

So I started a solution from scratch adding the stack components as I went. I got Castle IoC and MonoRail displaying a simple page. I added the Spark View Engine and still got the home/index.spark page to render. When I added the Rhino.Commons components that is when I got the error. That is when I finally had the ‘aha’ moment. All of the Google hits never gave me any real clue about what the problem was. Here is the definitive solution to the problem.

Once Rhino.Commons along with the IoC class is introduced you need to register the controllers. I never put this rather obvious conclusion in place because I wasn’t thinking it was caused by the Rhino.Commons IoC class. I kept looking at the web.config file and the controllers that were being registered there.

Here is how I registered the controller by placing this in the global.asax.cs file.

IoC.Container.Register(
                AllTypes.Of<IController>().FromAssemblyNamed("your controllers"));

All of my controllers extend SmartDispatcherController.