In the past I have had some great experience with Umbraco 6 and Windsor Castle as IoC. After more then a year not working with Umbraco I thought let's see what 7 has got in store (I like the backoffice!)
After creating a new project and using NuGet to install Umbraco 7.2.1 I decided to implement Windsor Castle as of my experience in the past.
After installing the IoC and setting up the installconfig my backoffice won't load anymore! See the following error:
Castle.MicroKernel.ComponentNotFoundException was unhandled by user code HelpLink=groups.google.com/group/castle-project-users HResult=-2146233088 Message=No component for supporting the service Umbraco.Web.Editors.AuthenticationController was found Source=Castle.Windsor StackTrace: at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy) at Castle.MicroKernel.DefaultKernel.Resolve(Type service, IDictionary arguments) at Castle.Windsor.WindsorContainer.Resolve(Type service) at Project.Composition.ObjectFactory.Resolve(Type type) in c:\Repositories\Project\1. Code\Project\Composition\ObjectFactory.cs:regel 24 at Project.Web.Composition.WindsorCompositionRoot.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType) in c:\Repositories\Project\1. Code\Project.web\Composition\WindsorCompositionRoot.cs:regel 22 at System.Web.Http.Controllers.HttpControllerDescriptor.CreateController(HttpRequestMessage request) at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsyncInternal(HttpRequestMessage request, CancellationToken cancellationToken) at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) InnerException: null
I just can't figure out what is happening or what the problem is. I only have this when I load the backoffice. It crashes already in the inlog screen. I have already tried several thing: Umbraco MVC with Castle Windsor https://gist.github.com/florisrobbemont/5821863 But I just can't figure it out.
edit 04-02-2015 ---->
This https://gist.github.com/florisrobbemont/5821863 is more or less what I used! What do you want to see more? My web.config the installers?
This is my boot class:
public class UmbracoBoot : IApplicationEventHandler
{
internal static IWindsorContainer Container;
public void OnApplicationInitialized(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
umbracoApplication.Disposed += umbracoApplication_Disposed;
}
void umbracoApplication_Disposed(object sender, System.EventArgs e)
{
Application.Stop();
}
protected void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
Container = new WindsorContainer()
.Install(Configuration.FromAppConfig())
.Register(Classes.FromThisAssembly().BasedOn<IController>().LifestyleTransient());
FilteredControllerFactoriesResolver.Current.InsertType<UmbracoFilteredControllerFactory>(0);
}
public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
RouteConfig.Register();
FilterConfig.Register();
BundleConfig.Register();
}
public void OnApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
Application.Create();
FilteredControllerFactoriesResolver.Current.InsertType<UmbracoFilteredControllerFactory>(0);
DependencyResolver.SetResolver(new WindsorDependencyResolver(Application.ObjectFactory));
GlobalConfiguration.Configuration.Services.Replace(typeof(IHttpControllerActivator), new WindsorCompositionRoot(Application.ObjectFactory));
Application.Start();
}
}