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)

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)]

The scope of the declaration that is allowed depends on the that is used.

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

Allows security actions for to be applied to code using declarative security.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  To be added.
  is not a valid value.

  Initializes a new instance of the class with the specified .

  One of the values.
  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission

  This method should only be called by the security system, never by application code.

  At compile time, attributes convert security declarations to a serialized form in metadata. Declarative security data in metadata is created from the permission that this method returns that corresponds to this attribute.

  Creates and returns a new .

  A that corresponds to this attribute.

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

  One or more of the values.

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

  Gets or sets the current allowed uses of reflection.

  0
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added. To be added.

  Gets or sets a value that indicates whether invocation of operations on non-public members is allowed.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Obsolete
  System.Boolean To be added.

  Starting with the net_v20sp1_long, emitting code no longer requires with the flag. Some features of reflection emit, such as emitting debug symbols, still require the flag. (See Security Issues in Reflection Emit.)

  To use this functionality, your application should target the net_v35_long or later.

  Gets or sets a value that indicates whether use of certain features in , such as emitting debug symbols, is allowed.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  This property is introduced in the net_v20sp1_long. To use this property, your application should target the net_v35_long or later.

  Gets or sets a value that indicates whether restricted invocation of non-public members is allowed. Restricted invocation means that the grant set of the assembly that contains the non-public member that is being invoked must be equal to, or a subset of, the grant set of the invoking assembly.

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

  This property is now obsolete. Reflecting on the metadata of members that are not visible no longer requires .

  Gets or sets a value that indicates whether reflection on members that are not visible is allowed.

0