diff --git a/src/Common/src/CoreLib/System/Diagnostics/Tracing/EventSource.cs b/src/Common/src/CoreLib/System/Diagnostics/Tracing/EventSource.cs index ce43ed093111..5c05bf83135d 100644 --- a/src/Common/src/CoreLib/System/Diagnostics/Tracing/EventSource.cs +++ b/src/Common/src/CoreLib/System/Diagnostics/Tracing/EventSource.cs @@ -181,6 +181,7 @@ using System.Text; using System.Threading; using Microsoft.Win32; +using Internal.Runtime.Augments; #if ES_BUILD_STANDALONE using EventDescriptor = Microsoft.Diagnostics.Tracing.EventDescriptor; @@ -196,10 +197,6 @@ using Contract = Microsoft.Diagnostics.Contracts.Internal.Contract; #endif -#if CORECLR || ES_BUILD_PN -using Internal.Runtime.Augments; -#endif - #if ES_BUILD_STANDALONE namespace Microsoft.Diagnostics.Tracing #else diff --git a/src/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/RuntimeSpecific.cs b/src/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/RuntimeSpecific.cs index 83f452cc8363..4d5bab48e4f9 100644 --- a/src/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/RuntimeSpecific.cs +++ b/src/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/RuntimeSpecific.cs @@ -243,3 +243,19 @@ internal static string GetResourceString(string key, params object[] args) } } } + +#if ES_BUILD_STANDALONE +namespace Internal.Runtime.Augments +{ + internal static class RuntimeThread + { + internal static ulong CurrentOSThreadId + { + get { return GetCurrentThreadId(); } + } + + [DllImport("kernel32.dll")] + private static extern uint GetCurrentThreadId(); + } +} +#endif \ No newline at end of file