SecurityException.Demanded 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 security permission, permission set, or permission set collection that failed.

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

<ComVisibleAttribute(False)>
Public Property Demanded As Object

Property Value

Type: System.Object

A permission, permission set, or permission set collection object.

In the case of a returned permission set or permission set collection, the returned object contains all the demanded permissions, one or more of which caused the failure.

The following code example shows the use of the Demanded property to display the demanded security permission, permission set, or permission set collection that failed. This code example is part of a larger example provided for the SecurityException class.

Display("The demanded permission is: " & sE.Demanded.ToString())

SecurityPermission

for the ability to manipulate the principal object. Associated enumerations: SecurityPermissionFlag.ControlEvidence, SecurityPermissionFlag.ControlPolicy Security action: Demand

.NET Framework
Available since 2.0
Return to top
Show: