I know it\'s possible to use DependencyResolver and register Castle Windsor with MVC but due to the issues described in https://stackoverflow.com/a/4889222/139392 we have st
I have managed to resolve from my windsor container by using GlobalConfiguration.Configuration.ServiceResolver.SetResolver as shown here.
private void BootStrapWindsorContainer()
{
_container = new WindsorContainer()
.Install(FromAssembly.This());
var controllerFactory = new WindsorControllerFactory(_container.Kernel);
ControllerBuilder.Current.SetControllerFactory(controllerFactory);
ServiceLocator.SetLocatorProvider(() => new WindsorServiceLocator(_container));
GlobalConfiguration.Configuration.ServiceResolver.SetResolver(
t =>
{
try
{
return _container.Resolve(t);
}
catch
{
return null;
}
},
t =>
{
try
{
return _container.ResolveAll(t).OfType
Returning null when you cannot resolve types works and it seems like MVC will new up the dependencies.
Edit: Make sure you have an installer for IHttpController