I have an MVC4 site using Castle Windsor that I want to add some WebAPI calls to, so I start digging around a little bit on the interwebs.
Now I don\'t know the ins
First as Iko stated you need to create a class that implements IHttpControllerActivator.
Then in ContainerBootstrapper in Bootstrap() add the following Replace the default with the one implemented:
//This will help in creating Web api with Dependency injection
GlobalConfiguration.Configuration.Services.Replace(
typeof(IHttpControllerActivator),
new WindsorCompositionRoot(container));
Lastly which is not mentioned here and it didn't work for me without it that you should add the following in you implemented IWindsorInstaller service inside install() :
container.Register(
Classes.FromThisAssembly()
.BasedOn()
.LifestyleTransient()
);