SecurityException::Demanded Property
Gets or sets the demanded security permission, permission set, or permission set collection that failed.
Assembly: mscorlib (in mscorlib.dll)
public: [ComVisibleAttribute(false)] property Object^ Demanded { [SecurityPermissionAttribute(SecurityAction::Demand, Flags = SecurityPermissionFlag::NoFlags | SecurityPermissionFlag::ControlEvidence | SecurityPermissionFlag::ControlPolicy)] Object^ get(); void set(Object^ value); }
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.
for the ability to manipulate the principal object. Associated enumerations: SecurityPermissionFlag::ControlEvidence, SecurityPermissionFlag::ControlPolicy Security action: Demand
Available since 2.0