From 9039c7764e989d97e59db4982cb2b73c5179b471 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Wed, 23 Jun 2021 14:56:44 +0200 Subject: [PATCH] Respect EventSource::IsSupported setting in more codepaths (#51977) --- .../src/System/Diagnostics/Tracing/EventSource.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs index 321d60d..d6093b4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs @@ -495,6 +495,9 @@ namespace System.Diagnostics.Tracing /// public override string ToString() { + if (!IsSupported) + return base.ToString()!; + return SR.Format(SR.EventSource_ToString, Name, Guid); } -- 2.7.4