I have a simple Sitecore controller that returns an list of items from Sitecore. It's used it in a custom SPEAK UI page.
This works fine in my local dev environment but when I deploy it into an Sitecore environment (which has Castle Windsor setup as an IoC) my controller no longer works. The error in the logs is: 'Could not create controller':
public class MyListBrowsingController : Controller
{
public JsonResult GetItems()
{
var myList = //get list here
return Json(myList, JsonRequestBehavior.AllowGet);
}
}
As I understand it the problem is that CastleWindsor is wired up via a pipeline and is overwritten the default Sitecore Dependency Resolver, e.g like so:
https://bitlush.com/blog/using-castle-windsor-with-sitecore-mvc-for-dependency-injection
I know ideally this would be solved with a fall-back like so: https://github.com/HedgehogDevelopment/sitecore-chained-dependency-resolver/blob/master/InversionOfControl.CastleWindsor/Pipelines/SetupDependencyResolvers.cs.
However unfortunately I don't have access / control of this code as it's in a separate dll so id like to explicitly register the route in some other way which won't get overwritten by an IoC.
Is there a way to do this?
Further info:
- Sitecore 7.5 > 8.1