internal static void RemoveThisAppDomainFromUnmanagedTable()
        {
            if (Interlocked.Exchange(ref s_isThisAppDomainRemovedFromUnmanagedTable, 1) != 0)
            {
                return;
            }

            //
            // only notify mgdeng of this shutdown if we went through
            // Initialize from the there
            // We can also have PipelineRuntime in app domains with only
            // other protocols
            //
            try {
                if (s_thisAppDomainsIsapiAppId != null && s_ApplicationContext != IntPtr.Zero)
                {
                    Debug.Trace("PipelineDomain", "Calling MgdAppDomainShutdown appId=" +
                                s_thisAppDomainsIsapiAppId + " (AppDomainAppId=" + HttpRuntime.AppDomainAppId + ")");

                    UnsafeIISMethods.MgdAppDomainShutdown(s_ApplicationContext);
                }

                HttpRuntime.AddAppDomainTraceMessage(SR.GetString(SR.App_Domain_Restart));
            }
            catch (Exception e) {
                if (ShouldRethrowException(e))
                {
                    throw;
                }
            }
        }
 internal static void RemoveThisAppDomainFromUnmanagedTable()
 {
     if (Interlocked.Exchange(ref _isThisAppDomainRemovedFromUnmanagedTable, 1) == 0)
     {
         try
         {
             string appDomainAppIdInternal = HttpRuntime.AppDomainAppIdInternal;
             if (appDomainAppIdInternal != null)
             {
                 System.Web.UnsafeNativeMethods.AppDomainRestart(appDomainAppIdInternal);
             }
             HttpRuntime.AddAppDomainTraceMessage(System.Web.SR.GetString("App_Domain_Restart"));
         }
         catch
         {
         }
     }
 }
 internal static void RemoveThisAppDomainFromUnmanagedTable()
 {
     if (Interlocked.Exchange(ref s_isThisAppDomainRemovedFromUnmanagedTable, 1) == 0)
     {
         try
         {
             if ((s_thisAppDomainsIsapiAppId != null) && (s_ApplicationContext != IntPtr.Zero))
             {
                 UnsafeIISMethods.MgdAppDomainShutdown(s_ApplicationContext);
             }
             HttpRuntime.AddAppDomainTraceMessage(System.Web.SR.GetString("App_Domain_Restart"));
         }
         catch (Exception exception)
         {
             if (ShouldRethrowException(exception))
             {
                 throw;
             }
         }
     }
 }
Beispiel #4
0
        internal static void RemoveThisAppDomainFromUnmanagedTable()
        {
            if (Interlocked.Exchange(ref _isThisAppDomainRemovedFromUnmanagedTable, 1) != 0)
            {
                return;
            }

            try {
                String appId = HttpRuntime.AppDomainAppId;
                if (appId != null)
                {
                    Debug.Trace("ISAPIRuntime", "Calling UnsafeNativeMethods.AppDomainRestart appId=" + appId);

                    UnsafeNativeMethods.AppDomainRestart(appId);
                }

                HttpRuntime.AddAppDomainTraceMessage(SR.GetString(SR.App_Domain_Restart));
            }
            catch {
            }
        }