private void Application_Start(object sender, EventArgs eventArgs) { Logger.InfoFormat("Application Starting ({0})", Globals.ElapsedSinceAppStart); // just to start the timer var name = Config.GetSetting("ServerName"); Globals.ServerName = string.IsNullOrEmpty(name) ? Dns.GetHostName() : name; var dependencyProvider = new LazyServiceProvider(); Globals.DependencyProvider = dependencyProvider; dependencyProvider.SetProvider(DependencyInjectionInitialize.BuildServiceProvider()); ServiceRequestScopeModule.SetServiceProvider(Globals.DependencyProvider); ComponentFactory.Container = new SimpleContainer(); ComponentFactory.InstallComponents(new ProviderInstaller("databaseConnection", typeof(DatabaseConnectionProvider), typeof(SqlDatabaseConnectionProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("data", typeof(DataProvider), typeof(SqlDataProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("caching", typeof(CachingProvider), typeof(FBCachingProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("logging", typeof(LoggingProvider), typeof(DBLoggingProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("scheduling", typeof(SchedulingProvider), typeof(DNNScheduler))); ComponentFactory.InstallComponents(new ProviderInstaller("searchIndex", typeof(IndexingProvider), typeof(ModuleIndexer))); #pragma warning disable 0618 ComponentFactory.InstallComponents(new ProviderInstaller("searchDataStore", typeof(SearchDataStoreProvider), typeof(SearchDataStore))); #pragma warning restore 0618 ComponentFactory.InstallComponents(new ProviderInstaller("members", typeof(MembershipProvider), typeof(AspNetMembershipProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("roles", typeof(RoleProvider), typeof(DNNRoleProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("profiles", typeof(ProfileProvider), typeof(DNNProfileProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("permissions", typeof(PermissionProvider), typeof(CorePermissionProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("outputCaching", typeof(OutputCachingProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("moduleCaching", typeof(ModuleCachingProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("sitemap", typeof(SitemapProvider), typeof(CoreSitemapProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("friendlyUrl", typeof(FriendlyUrlProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("folder", typeof(FolderProvider))); RegisterIfNotAlreadyRegistered <FolderProvider, StandardFolderProvider>("StandardFolderProvider"); RegisterIfNotAlreadyRegistered <FolderProvider, SecureFolderProvider>("SecureFolderProvider"); RegisterIfNotAlreadyRegistered <FolderProvider, DatabaseFolderProvider>("DatabaseFolderProvider"); RegisterIfNotAlreadyRegistered <PermissionProvider>(); ComponentFactory.InstallComponents(new ProviderInstaller("htmlEditor", typeof(HtmlEditorProvider), ComponentLifeStyleType.Transient)); ComponentFactory.InstallComponents(new ProviderInstaller("navigationControl", typeof(NavigationProvider), ComponentLifeStyleType.Transient)); ComponentFactory.InstallComponents(new ProviderInstaller("clientcapability", typeof(ClientCapabilityProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("cryptography", typeof(CryptographyProvider), typeof(FipsCompilanceCryptographyProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("tokens", typeof(TokenProvider))); ComponentFactory.InstallComponents(new ProviderInstaller("mail", typeof(MailProvider))); Logger.InfoFormat("Application Started ({0})", Globals.ElapsedSinceAppStart); // just to start the timer DotNetNukeShutdownOverload.InitializeFcnSettings(); // register the assembly-lookup to correct the breaking rename in DNN 9.2 DotNetNuke.Services.Zip.SharpZipLibRedirect.RegisterSharpZipLibRedirect(); // DotNetNukeSecurity.Initialize(); }
private static void SetupContainer() { Globals.DependencyProvider = DependencyInjectionInitialize.BuildServiceProvider(); }