Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Setup Castle Windsor for Sitecore 8.1
<?xml version="1.0"?>
<configuration>
<sitecore>
<pipelines>
<initialize>
<processor type="Website.SetupIoc, Website" />
</initialize>
</pipelines>
</sitecore>
</configuration>
using System.Web.Mvc;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using CommonServiceLocator.WindsorAdapter;
using Sitecore.Pipelines;
namespace Website
{
public class SetupIoc
{
public void Process(PipelineArgs args)
{
var container = new WindsorContainer();
container.Register(Classes.FromThisAssembly().BasedOn<IController>().LifestyleTransient());
DependencyResolver.SetResolver(new WindsorServiceLocator(container));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment