Inheritance security rules violated while overriding member – SecurityRuleSet.Level2

Mark GetObjectData with SecurityCriticalAttribute, because it’s applied to Exception.GetObjectData. An overridden member should have the same security accessibility (Critical, Safe Critical or Transparent).

Read Security Changes in the .NET Framework 4 and Security Transparent Code, Level 2 from MSDN for more information.

To avoid all potential security runtime exceptions, enable Code Analysis with the Security rule set. You’ll get static analysis warnings that might correspond to runtime errors.

Leave a Comment