protected override void ConfigureContainer() { base.ConfigureContainer(); Log.Debug($"Configuring {Container}, catalog: {ModuleCatalog} (type: {ModuleCatalog.GetType()})"); if (ModuleCatalog is IAppModuleLoader appModuleLoader) { Container.RegisterInstance(appModuleLoader, new ContainerControlledLifetimeManager()); } else { throw new ApplicationException($"ModuleCatalog must be of type {nameof(IAppModuleLoader)}, got {ModuleCatalog}"); } }