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

HostProtectionException

The exception that is thrown when a denied host resource is detected.

Gets or sets the demanded host protection resources that caused the exception to be thrown.

Gets or sets the host protection resources that are inaccessible to partially trusted code.

Initializes a new instance of the HostProtectionException class with default values.

public HostProtectionException(string message)

Initializes a new instance of the HostProtectionException class with a specified error message.

public HostProtectionException(string message, Exception e)

Initializes a new instance of the HostProtectionException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public HostProtectionException(string message, HostProtectionResource protectedResources, HostProtectionResource demandedResources)

Initializes a new instance of the HostProtectionException class with a specified error message, the protected host resources, and the host resources that caused the exception to be thrown.

Initializes a new instance of the HostProtectionException class using the provided serialization information and streaming context.