<PackageReference Include="System.Drawing.Common" Version="10.0.0-preview.1.25080.3" />

ExceptionExtensions

static class ExceptionExtensions
using System.Runtime.CompilerServices; using System.Threading; namespace System { internal static class ExceptionExtensions { [NullableContext(1)] public static bool IsCriticalException(this Exception ex) { if (!(ex is NullReferenceException) && !(ex is StackOverflowException) && !(ex is OutOfMemoryException) && !(ex is ThreadAbortException) && !(ex is IndexOutOfRangeException) && !(ex is AccessViolationException)) return false; return true; } } }