Share via


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 值的按位组合,用于标识导致引发异常的保护资源。 默认值为 None

注解

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

适用于