HostProtectionException.DemandedResources 属性

定义

获取或设置导致引发异常的要求的主机保护资源。

public:
 property System::Security::Permissions::HostProtectionResource DemandedResources { System::Security::Permissions::HostProtectionResource get(); };
public System.Security.Permissions.HostProtectionResource DemandedResources { get; }
member this.DemandedResources : System.Security.Permissions.HostProtectionResource
Public ReadOnly Property DemandedResources As HostProtectionResource

属性值

HostProtectionResource

HostProtectionResource 值的按位组合,用于标识导致引发异常的保护资源。 默认值为 None

注解

此属性返回导致引发异常的所需主机保护类别。 例如,假设方法具有一个 HostProtectionAttribute 指示该方法公开共享状态的属性。 调用该方法时,将 HostProtectionAttribute 执行共享状态的链接需求。 如果主机已将共享状态设置为禁止类别,则会引发 a HostProtectionException ,并且 DemandedResources 属性值为 HostProtectionResource.SharedState

适用于