public static void StartApplication() { if (Disabled || startWasCalled || Initializer.Executed) { return; } try { lock (lockObject) { var disabled = WebConfigurationManager.AppSettings["BoC.Web.DisableAutoStart"]; if ("true".Equals(disabled, StringComparison.InvariantCultureIgnoreCase)) { Disabled = true; return; } if (startWasCalled) { return; } Initializer.Execute(); startWasCalled = true; } } catch { InfrastructureHelper.UnloadAppDomain(); throw; } }
public static void StartApplication() { if (startWasCalled || Initializer.Executed) { return; } try { lock (lockObject) { if (startWasCalled) { return; } Initializer.Execute(); startWasCalled = true; } } catch { InfrastructureHelper.UnloadAppDomain(); throw; } }
private static void OnChanged(string key, object value, CacheItemRemovedReason reason) { // Only handle case when the dependency has changed. if (reason != CacheItemRemovedReason.DependencyChanged) { return; } // Scan the app root for a webpages file if ( WebPagesDeployment.AppRootContainsWebPagesFile( _physicalFileSystem, HttpRuntime.AppDomainAppPath ) ) { // Unload the app domain so we register plan9 when the app restarts InfrastructureHelper.UnloadAppDomain(); } else { // We need to re-register since the item was removed from the cache RegisterForChangeNotifications(); } }
private static void ShutdownCallBack(object state) { InfrastructureHelper.UnloadAppDomain(); }