Fix desktop build break
authorJan Kotas <jkotas@microsoft.com>
Wed, 18 Jul 2018 21:02:13 +0000 (14:02 -0700)
committerJan Kotas <jkotas@microsoft.com>
Thu, 19 Jul 2018 19:47:37 +0000 (12:47 -0700)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/f26b8eea691d51332b2bd46ff32643f235c8ab14

src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs

index 534e387..6ee5f25 100644 (file)
@@ -4049,8 +4049,12 @@ namespace System.Diagnostics.Tracing
                 if (!s_EventSourceShutdownRegistered)
                 {
                     s_EventSourceShutdownRegistered = true;
+#if ES_BUILD_PN
+                    AppContext.ProcessExit += DisposeOnShutdown;
+#else
                     AppDomain.CurrentDomain.ProcessExit += DisposeOnShutdown;
                     AppDomain.CurrentDomain.DomainUnload += DisposeOnShutdown;
+#endif
                 }
 
 
@@ -5943,4 +5947,3 @@ namespace System.Diagnostics.Tracing
 
 #endregion
 }
-