NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ReflectionPermission

ReflectionPermission controls access to metadata through the Reflection APIs. With ReflectionPermission, code can access all the types in its application domain, assembly, and module. It can find out all kinds of information about the public, family, and even private members of any type it can get to. At best, this access reveals implementation details; at worst, it exposes intellectual property. Even though private members of a class may be exposed, they cannot be executed from semi-trusted code unless the access rules allow it — even if that code has ReflectionPermission. It would be prudent not to grant ReflectionPermission to Internet code.

ReflectionPermission grants two primary capabilities:

The specific ReflectionPermission flags are as follows:

TypeInformation. This flag is required to reflect on nonpublic members of a type. Note that by default, Reflection will not allow you to access Family members of a type.

MemberAccess. This flag controls invocation of operations on type members. A caller needs this permission to invoke operations on members that are inaccessible according to the Virtual Object System (VOS) rules. For example, the caller needs this permission to call Type.InvokeMember on a private method of a type.

ReflectionEmit. The permission is required for Reflection Emit operations.