<PackageReference Include="System.Security.Permissions" Version="10.0.0-preview.6.25358.103" />

PolicyException

The exception that is thrown when policy forbids code to run.
using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.Serialization; namespace System.Security.Policy { [Serializable] [TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public class PolicyException : SystemException { public PolicyException() { } [Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId = "SYSLIB0051", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] [EditorBrowsable(EditorBrowsableState.Never)] protected PolicyException(SerializationInfo info, StreamingContext context) : base(info, context) { } public PolicyException(string message) : base(message) { } public PolicyException(string message, Exception exception) : base(message, exception) { } } }