You are on page 1of 1

Table 17-2.

SecurityException Properties (continued)

Property Description
InheritanceDemand
InheritanceDemandChoice
LinkDemand
LinkDemandChoice
PermitOnly
RequestMinimum
RequestOptional
RequestRefuseusing
Data An IDictionary of user-defined key-value pairs.
Demanded Returns the permission(s) that caused the Demand to fail. The returned object
needs to be cast to a Permission, PermissionSet, or
PermissionSetCollection type in order to access its information. You can
use the is keyword to determine which one of these types this property returned.
DenySetInstance Returns the denied permission(s) that caused the Demand to fail. This property
contains a value whenever a Deny higher up in the stack causes a Demand to fail.
The returned object needs to be cast to a Permission, PermissionSet, or
PermissionSetCollection type in order to access its information. You can
use the is keyword to determine which one of these types this property returned.
FailedAssemblyInfo Returns an AssemblyName object for the assembly where this exception
occurred (i.e., the assembly where the Demand that failed was called).
FirstPermissionThatFailed Returns an IPermission object of the first permission that failed. This is useful
when several permissions in a permission set were demanded at one time. This
property identifies which permission caused the exception to occur.
Method Returns a MethodInfo object for the method where this exception originated. If
the cause of the exception was due to a Deny or PermitOnly, the method con-
taining the Deny or PermitOnly will be returned by this property. From this
object you can also obtain information on the type and assembly that contain this
method.
PermitOnlySetInstance Returns the permission(s) that were set by a PermitOnly at the point where the
security exception was thrown. The returned object needs to be cast to a
Permission, PermissionSet, or PermissionSetCollection type in
order to access its information. You can use the is keyword to determine which
one of these types this property returned.
URL Returns a string representing the URL of the assembly where this exception
originated.
Zone Returns a SecurityZone enumeration value indicating the zone of the assem-
bly where this exception originated. Possible values can be any of the following:
Internet
Intranet
MyComputer
NoZone
Trusted
Untrusted

Obtaining the Full Reason a SecurityException Was Thrown | 711

You might also like