HostProtectionException.DemandedResources Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.Security
Assembly:  mscorlib (in mscorlib.dll)

public HostProtectionResource DemandedResources { get; }

Property Value

Type: System.Security.Permissions.HostProtectionResource

A bitwise combination of the HostProtectionResource values identifying the protection resources causing the exception to be thrown. The default is HostProtectionResource.None.

This property returns the demanded host protection categories that caused the exception to be thrown. For example, suppose that a method has a HostProtectionAttribute attribute that indicates that the method exposes shared state. When the method is called, the HostProtectionAttribute performs a link demand for shared state. If the host has set shared state as a prohibited category, then a HostProtectionException is raised, and the value of the DemandedResources property is HostProtectionResource.SharedState.

.NET Framework
Available since 2.0
Return to top
Show: