<PackageReference Include="System.Drawing.Common" Version="9.0.0-preview.7.24405.4" />

ClientUtils

static class ClientUtils
using System.Runtime.CompilerServices; using System.Security; using System.Threading; namespace System.Drawing { [NullableContext(1)] [Nullable(0)] internal static class ClientUtils { public static bool IsCriticalException(Exception ex) { if (!(ex is NullReferenceException) && !(ex is StackOverflowException) && !(ex is OutOfMemoryException) && !(ex is ThreadAbortException) && !(ex is ExecutionEngineException) && !(ex is IndexOutOfRangeException) && !(ex is AccessViolationException)) return false; return true; } public static bool IsSecurityOrCriticalException(Exception ex) { if (!(ex is SecurityException)) return IsCriticalException(ex); return true; } } }