public void StopProcessing()
 {
     if (UnsafeIISMethods.MgdHasConfigChanged() && !HostingEnvironment.ShutdownInitiated)
     {
         HttpRuntime.SetShutdownReason(ApplicationShutdownReason.ConfigurationChange, "IIS configuration change");
     }
     s_StopProcessingCalled = true;
     HostingEnvironment.InitiateShutdownWithoutDemand();
 }
        public void StopProcessing()
        {
            Debug.Trace("PipelineDomain", "StopProcessing with stack = " + Environment.StackTrace
                        + " for AppId= " + s_thisAppDomainsIsapiAppId);

            if (!HostingEnvironment.StopListeningWasCalled && !HostingEnvironment.ShutdownInitiated)
            {
                // If GL_STOP_LISTENING wasn't triggered, the reset is likely due to a configuration change.
                HttpRuntime.SetShutdownReason(ApplicationShutdownReason.ConfigurationChange, "IIS configuration change");
            }

            s_StopProcessingCalled = true;
            // inititate shutdown and
            // require the native callback for Stop
            HostingEnvironment.InitiateShutdownWithoutDemand();
        }