/// <summary> /// Called when the application starts. /// </summary> protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); RouteConfig.RegisterRoutes(RouteTable.Routes); FilterConfig.RegisterGlobalMvcFilters(GlobalFilters.Filters); FilterConfig.RegisterWebApiFilters(GlobalConfiguration.Configuration.Filters); // intialize our application domain PartnerCenterClient and PortalLocalization ApplicationDomain.BootstrapAsync().Wait(); // configure the web portal client application string portalConfigurationPath = ApplicationConfiguration.WebPortalConfigurationFilePath; if (string.IsNullOrWhiteSpace(portalConfigurationPath)) { throw new ConfigurationErrorsException("WebPortalConfigurationPath setting not found in web.config"); } // intialize our application domain ApplicationDomain.InitializeAsync().Wait(); // create the web portal configuration manager IWebPortalConfigurationFactory webPortalConfigFactory = new WebPortalConfigurationFactory(); ApplicationConfiguration.WebPortalConfigurationManager = webPortalConfigFactory.Create(portalConfigurationPath); // setup the application assets bundles ApplicationConfiguration.WebPortalConfigurationManager.UpdateBundles(Bundler.Instance).Wait(); }
protected void Application_Start() { IExplorerProvider provider; try { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); System.Web.Helpers.AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier; // intialize our application domain PartnerCenterClient and PortalLocalization Task.Run(() => ApplicationDomain.BootstrapAsync()).Wait(); // intialize our User domain PartnerCenterClient and PortalLocalization //Task.Run(() => ApplicationDomain.UserAsync()).Wait(); Database.SetInitializer <ViewModel.Context.ConnectionStringsContext>(null); provider = UnityConfig.Container.Resolve <IExplorerProvider>(); // intialize our application domain Task.Run(() => ApplicationDomain.InitializeAsync()).Wait(); } finally { provider = null; } }