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

PermissionSetAttribute

Allows security actions for a PermissionSet to be applied to code using declarative security. This class cannot be inherited.
public string File { get; set; }

Gets or sets a file containing the XML representation of a custom permission set to be declared.

public string Hex { get; set; }

Gets or sets the hexadecimal representation of the XML encoded permission set.

public string Name { get; set; }

Gets or sets the name of the permission set.

public bool UnicodeEncoded { get; set; }

Gets or sets a value indicating whether the file specified by File is Unicode or ASCII encoded.

public string XML { get; set; }

Gets or sets the XML representation of a permission set.

Initializes a new instance of the PermissionSetAttribute class with the specified security action.

Creates and returns a new permission set based on this permission set attribute object.