/// <exclude /> public static void ApplicationStartInitialize(bool displayDebugInfo = false) { ThreadDataManager.InitializeThroughHttpContext(); if (displayDebugInfo) { Log.LogVerbose("Global.asax", "--- Web Application Start, {0} Id = {1} ---", DateTime.Now.ToLongTimeString(), AppDomain.CurrentDomain.Id); } PerformanceCounterFacade.SystemStartupIncrement(); using (GlobalInitializerFacade.GetPreInitHandlersScope()) { ApplicationStartupFacade.FireConfigureServices(ServiceLocator.ServiceCollection); ServiceLocator.BuildServiceProvider(); ServiceLocator.CreateRequestServicesScope(HttpContext.Current); ApplicationStartupFacade.FireBeforeSystemInitialize(ServiceLocator.ServiceProvider); } TempDirectoryFacade.OnApplicationStart(); HostnameBindingsFacade.Initialize(); ApplicationStartupFacade.FireSystemInitialized(ServiceLocator.ServiceProvider); ThreadDataManager.FinalizeThroughHttpContext(); }
void context_BeginRequest(object sender, EventArgs e) { if (!SystemSetupFacade.IsSystemFirstTimeInitialized) { return; } ThreadDataManager.InitializeThroughHttpContext(true); var httpContext = (sender as HttpApplication).Context; if (CheckForHostnameAliasRedirect(httpContext)) { return; } if (HandleMediaRequest(httpContext)) { return; } SetCultureByHostname(); PrettifyPublicMarkup(httpContext); HandleRootRequestInClassicMode(httpContext); }
/// <exclude /> public static void Application_BeginRequest(object sender, EventArgs e) { var context = (sender as HttpApplication).Context; ThreadDataManager.InitializeThroughHttpContext(); ServiceLocator.CreateRequestServicesScope(context); if (LogRequestDetails) { // LoggingService.LogVerbose("Begin request", string.Format("{0}", Request.Path)); context.Items.Add("Global.asax timer", Environment.TickCount); } }
void context_BeginRequest(object sender, EventArgs e) { if (!SystemSetupFacade.IsSystemFirstTimeInitialized) { return; } ThreadDataManager.InitializeThroughHttpContext(); var httpContext = (sender as HttpApplication).Context; if (CheckForHostnameAliasRedirect(httpContext)) { return; } IHostnameBinding hostnameBinding = HostnameBindingsFacade.GetBindingForCurrentRequest(); if (hostnameBinding != null && hostnameBinding.EnforceHttps && !httpContext.Request.IsSecureConnection) { RedirectToHttps(httpContext); return; } if (HandleMediaRequest(httpContext)) { return; } SetCultureByHostname(hostnameBinding); PrettifyPublicMarkup(httpContext); HandleRootRequestInClassicMode(httpContext); }