System.Web.HttpRuntime.ShutdownAppDomain C# (CSharp) Method

ShutdownAppDomain() static private method

static private ShutdownAppDomain ( ) : void
return void
		static void ShutdownAppDomain ()
		{
			queue_manager.Dispose ();
			// This will call Session_End if needed.
			InternalCache.InvokePrivateCallbacks ();
			// Kill our application.
			HttpApplicationFactory.Dispose ();
			ThreadPool.QueueUserWorkItem (delegate {
				try {
					DoUnload ();
				} catch {
				}});
		}

Usage Example

        private void OnAppFileChange(Object sender, FileChangeEvent e)
        {
            // shutdown the app domain if app file changed
            Debug.Trace("AppDomainFactory", "Shutting down appdomain because of application file change");
            string message = FileChangesMonitor.GenerateErrorMessage(e.Action, e.FileName);

            if (message == null)
            {
                message = "Change in GLOBAL.ASAX";
            }
            HttpRuntime.ShutdownAppDomain(ApplicationShutdownReason.ChangeInGlobalAsax, message);
        }
All Usage Examples Of System.Web.HttpRuntime::ShutdownAppDomain