System.Security.Permissions.CodeAccessSecurityAttribute Class

Specifies the base attribute class for code access security.

See Also: CodeAccessSecurityAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.All, AllowMultiple=true, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class CodeAccessSecurityAttribute : SecurityAttribute

Remarks

This attribute class associates a System.Security.Permissions.SecurityAction, for example, Demand, with a custom security attribute.

The types that derive from System.Security.Permissions.CodeAccessSecurityAttribute are used to help restrict 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 only for declarative security. Use the corresponding permission class derived from System.Security.CodeAccessPermission for imperative security.

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Requirements

Namespace: System.Security.Permissions
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0