public abstract class CodeAccessSecurityAttribute : SecurityAttribute
Object
Attribute
SecurityAttribute
CodeAccessSecurityAttribute
mscorlib
BCL
This is the base class for code access security attributes.
[Note: The types that derive from CodeAccessSecurityAttribute are used to secure access to resources or securable operations.The security information declared by a security attribute is stored in the metadata of the attribute target, and is accessed by the system at run-time. Security attributes are used for declarative security only. Use the corresponding permission class derived from CodeAccessPermission for imperative security.
]
AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple=true, Inherited=false)
System.Security.Permissions Namespace
CodeAccessSecurityAttribute Constructors
public CodeAccessSecurityAttribute(SecurityAction action);
Constructs and initializes a new instance of CodeAccessSecurityAttribute with the specified SecurityAction value.
- action
- A SecurityAction value.
Exception Type Condition ArgumentException action is not a valid SecurityAction value.
System.Security.Permissions.CodeAccessSecurityAttribute Class, System.Security.Permissions Namespace