SecurityException.Demanded Property

Definition

Gets or sets the demanded security permission, permission set, or permission set collection that failed.

public object? Demanded { get; set; }
public object Demanded { get; set; }
[System.Runtime.InteropServices.ComVisible(false)]
public object Demanded { get; set; }

Property Value

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

Attributes

Examples

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());

Remarks

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.

Applies to