System.Security.Permissions.CodeAccessSecurityAttribute Class

public abstract class CodeAccessSecurityAttribute : SecurityAttribute

Base Types

Object
  Attribute
    SecurityAttribute
      CodeAccessSecurityAttribute

Assembly

mscorlib

Library

BCL

Summary

This is the base class for code access security attributes.

Description

[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.

]

Attributes

AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple=true, Inherited=false)

See Also

System.Security.Permissions Namespace

Members

CodeAccessSecurityAttribute Constructors

CodeAccessSecurityAttribute() Constructor
CodeAccessSecurityAttribute(System.Security.Permissions.SecurityAction) Constructor


CodeAccessSecurityAttribute() Constructor

protected CodeAccessSecurityAttribute();

Summary

Constructs a new instance of the CodeAccessSecurityAttribute class.

See Also

System.Security.Permissions.CodeAccessSecurityAttribute Class, System.Security.Permissions Namespace

CodeAccessSecurityAttribute(System.Security.Permissions.SecurityAction) Constructor

public CodeAccessSecurityAttribute(SecurityAction action);

Summary

Constructs and initializes a new instance of CodeAccessSecurityAttribute with the specified SecurityAction value.

Parameters

action
A SecurityAction value.

Exceptions

Exception TypeCondition
ArgumentExceptionaction is not a valid SecurityAction value.

See Also

System.Security.Permissions.CodeAccessSecurityAttribute Class, System.Security.Permissions Namespace