See Also: HostProtectionException Members
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.
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.