System.Security.HostProtectionException Class

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

See Also: HostProtectionException Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public class HostProtectionException : SystemException

Remarks

A System.Security.Permissions.HostProtectionAttribute attribute is used to determine if a type or member can be loaded, based on the host’s protection preferences established when the common language runtime is started. If a type or member with an active System.Security.Permissions.HostProtectionAttribute is called, a link demand occurs for that protection attribute. If the caller does not meet the demand for host protection, a System.Security.HostProtectionException is thrown.

Note:

A System.Security.Permissions.HostProtectionAttribute is not a permission, even though it is the target of a link demand. Because a System.Security.HostProtectionException is thrown for a link demand, it cannot be handled, and therefore it cannot be trapped and processed in code.

Requirements

Namespace: System.Security
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0