Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Respond to PR comments
  • Loading branch information
agocke committed Aug 13, 2021
commit 8002ac9e3933f49936b8720adbbde86f2cd54eea
6 changes: 4 additions & 2 deletions src/libraries/System.Private.CoreLib/src/System/AppContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public static void SetSwitch(string switchName, bool isEnabled)
}
}

#if NETCOREAPP
internal static void LogSwitchValues(RuntimeEventSource ev)
{
if (s_switches is not null)
Expand All @@ -155,14 +156,15 @@ internal static void LogSwitchValues(RuntimeEventSource ev)
{
foreach (var (k, v) in s_dataStore)
{
if (v is bool b)
if (bool.TryParse(v, out bool isEnabled))
{
ev.LogAppContextSwitch(k, b ? 0 : 1);
ev.LogAppContextSwitch(k, isEnabled ? 0 : 1);
}
}
}
}
}
#endif

#if !CORERT
internal static unsafe void Setup(char** pNames, char** pValues, int count)
Expand Down