See Also: ReflectionPermission Members
System.Object
System.Security.CodeAccessPermission
System.Security.Permissions.ReflectionPermission
All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.
Code with the appropriate System.Security.Permissions.ReflectionPermission has access to non-public members of a type . Without System.Security.Permissions.ReflectionPermission , code can access only the public members of assemblies.
Note:Without System.Security.Permissions.ReflectionPermission, untrusted code can perform the following operations on members of loaded assemblies:
- Obtain type information from metadata for public types and members.
- Invoke public members.
- Invoke members defined with family access in the calling code's base classes.
- Invoke members defined with assembly access in the calling code's assembly.
- Invoke members defined with FamilyAndAssembly or FamilyOrAssembly access in the calling code's base classes and/or assembly.
- Enumerate assemblies.
- Enumerate public types.
- Enumerate types in the calling code's assembly.
System.Security.Permissions.ReflectionPermission instances can allow untrusted code to obtain type and member information, invoke members, and enumerate types that would otherwise be inaccessible.
Note: Because System.Security.Permissions.ReflectionPermission can provide access to members and information that were not intended for public access, it is recommended that System.Security.Permissions.ReflectionPermission be granted only to trusted code.The XML encoding of a System.Security.Permissions.ReflectionPermission instance is defined below in EBNF format. The following conventions are used:
- All non-literals in the grammar below are shown in normal type.
- All literals are in bold font.
The following meta-language symbols are used:
- '*' represents a meta-language symbol suffixing an expression that can appear zero or more times.
- '?' represents a meta-language symbol suffixing an expression that can appear zero or one time.
- '+' represents a meta-language symbol suffixing an expression that can appear one or more times.
- '(',')' is used to group literals, non-literals or a mixture of literals and non-literals.
- '|' denotes an exclusive disjunction between two expressions.
- '::= ' denotes a production rule where a left hand non-literal is replaced by a right hand expression containing literals, non-literals or both.
BuildVersion refers to the build version of the shipping CLI. This is specified as a dotted build number such as '2412.0' .
ECMAPubKeyToken ::= b77a5c561934e089
ReflectionPermissionFlag = MemberAccess | TypeInformation
Each ReflectionPermissionFlag can appear in the XML no more than once. For example, Flags=MemberAccess,MemberAccess is illegal.
The XML encoding of a System.Security.Permissions.ReflectionPermission instance is as follows:
ReflectionPermissionXML ::=
<IPermission
class="
System.Security.Permissions.ReflectionPermission, mscorlib,
Version=1.0.BuildVersion,
Culture=neutral,
PublicKeyToken=ECMAPubKeyToken"
version="1"
(
Unrestricted="true"
)
|
(
Flags="NoFlags | (ReflectionPermissionFlag (,ReflectionPermissionFlag)*"
)
/>
Namespace: System.Security.Permissions
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0