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

ReflectionPermissionAttribute

Allows security actions for ReflectionPermission to be applied to code using declarative security.
public ReflectionPermissionFlag Flags { get; set; }

Gets or sets the current allowed uses of reflection.

public bool MemberAccess { get; set; }

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

public bool ReflectionEmit { get; set; }

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

public bool RestrictedMemberAccess { get; set; }

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.

public bool TypeInformation { get; set; }

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

Initializes a new instance of the ReflectionPermissionAttribute class with the specified SecurityAction.