Reflection mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.Security.Permissions.CodeAccessSecurityAttribute 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)

Used to declaratively specify security actions to control access to non-public types using reflection.

The level of access to non-public types and members is specified using the property and the enumeration.

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. For imperative security, use the corresponding permission class, .

The allowable targets are determined by the passed to the constructor.

The following example shows a declarative request for access to non-public members of loaded assemblies. The security action indicates that this is the minimum permission required for the target assembly to be able to execute.

[assembly:ReflectionPermissionAttribute(SecurityAction.RequestMinimum, MemberAccess=true)]

The following example shows how to demand that the calling code has unrestricted access to non-public types. Demands are typically made to protect methods or classes from malicious code.

[ReflectionPermissionAttribute(SecurityAction.Demand, Unrestricted=true)]

- Constructor
  A value.

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

  To be added.
  is not a valid value.
  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Security.IPermission

  Returns a new that contains the security information of the current instance.

  A new object with the security information of the current instance.

  Applications typically do not call this method; it is intended for use by the system.

  The security information described by a security attribute is stored in the metadata of the attribute target, and is accessed by the system at run-time. The system uses the object returned by this method to convert the security information of the current instance into the form stored in metadata.

  This method overrides .

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.Security.Permissions.ReflectionPermissionFlag

  Gets or sets levels of access to non-public types using reflection.

  One or more of the values.

  To specify multiple values for a set operation, use the bitwise OR operator.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.Boolean To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.Boolean To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added. To be added. To be added.
- Property
  System.Boolean To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0 System.Obsolete("not enforced in 2.0+")
0