internal static void PreloadApplicationIfNotShuttingdown(string appId, LockableAppDomainContext ac) { WaitCallback callBack = null; if ((DefaultHost != null) && UnsafeIISMethods.MgdHasConfigChanged()) { if (callBack == null) { callBack = delegate(object o) { lock (ac) { try { DefaultHost.PreloadApplicationIfRequired(appId, null, null, ac); } catch (Exception exception) { DefaultHost.ReportApplicationPreloadFailureWithAssert(ac.PreloadContext, -2147467259, Misc.FormatExceptionMessage(exception, new string[] { System.Web.SR.GetString("Failure_Preload_Application_Initialization") })); } } }; } ThreadPool.QueueUserWorkItem(callBack); } }
public void StopProcessing() { if (UnsafeIISMethods.MgdHasConfigChanged() && !HostingEnvironment.ShutdownInitiated) { HttpRuntime.SetShutdownReason(ApplicationShutdownReason.ConfigurationChange, "IIS configuration change"); } s_StopProcessingCalled = true; HostingEnvironment.InitiateShutdownWithoutDemand(); }