Adding ServiceLocatorDependencyResolver causes error

I'm trying to add the the ServiceLocatorDependencyResolver from the Alloy project to my EPiServer 11 project, but when registering it in the Initialization I get the following error:

An instance of IControllerFactory was found in the resolver as well as a custom registered provider in ControllerBuilder.GetControllerFactory. Please set only one or the other.

A bit unsure of the required settings to make the resolver work. The code in the DependencyResolver InitializationModule looks like this:

 public void ConfigureContainer(ServiceConfigurationContext context)
        {
            context.ConfigurationComplete += (o, e) =>
            {
                //Register custom implementations that should be used in favour of the default implementations
                context.Services.AddTransient<IContentRenderer, ErrorHandlingContentRenderer>()
                    .AddHttpContextOrThreadScoped<LayoutModel, LayoutModel>();
            };
        }

        public void Initialize(InitializationEngine context)
        {
            //Add initialization logic, this method is called once after CMS has been initialized
            DependencyResolver.SetResolver(new ServiceLocatorDependencyResolver(context.Locate.Advanced));
        }

All help appreciated.

#187141 Jan 13, 2018 0:06