Setup Castle Windsor for Sitecore 8.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration> | |
<sitecore> | |
<pipelines> | |
<initialize> | |
<processor type="Website.SetupIoc, Website" /> | |
</initialize> | |
</pipelines> | |
</sitecore> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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