private static void BreakCanThrow() { if (!Debugger.IsAttached) { new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand(); } Debugger.BreakInternal(); }
public static void Break() { if (!Debugger.IsAttached) { try { new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand(); } catch (SecurityException) { return; } } Debugger.BreakInternal(); }