<PackageReference Include="System.Security.Permissions" Version="9.0.6" />

ReflectionPermissionFlag

Specifies the permitted use of the Reflection and Emit namespaces.

TypeInformation , MemberAccess, and ReflectionEmit are set. AllFlags does not include RestrictedMemberAccess.

Invocation operations on all members are allowed, regardless of grant set. If this flag is not set, invocation operations are allowed only on visible members.

NoFlags = 0

Enumeration of types and members is allowed. Invocation operations are allowed on visible types and members.

Emitting debug symbols is allowed. Beginning with the .NET Framework 2.0 Service Pack 1, this flag is no longer required to emit code.

Restricted member access is provided for partially trusted code. Partially trusted code can access nonpublic types and members, but only if the grant set of the partially trusted code includes all permissions in the grant set of the assembly that contains the nonpublic types and members being accessed. This flag is new in the .NET Framework 2.0 SP1.

This flag is obsolete. No flags are necessary to enumerate types and members and to examine their metadata. Use NoFlags instead.