<PackageReference Include="System.Security.AccessControl" Version="4.6.0" />

PrivilegeNotHeldException

The exception that is thrown when a method in the AccessControl namespace attempts to enable a privilege that it does not have.
public string PrivilegeName { get; }

Gets the name of the privilege that is not enabled.

Initializes a new instance of the PrivilegeNotHeldException class.

public PrivilegeNotHeldException(string privilege)

Initializes a new instance of the PrivilegeNotHeldException class by using the specified privilege.

public PrivilegeNotHeldException(string privilege, Exception inner)

Initializes a new instance of the PrivilegeNotHeldException class by using the specified exception.