Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SecurityException::Demanded Property

 

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

Namespace:   System.Security
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.

Display("The demanded permission is: {0}",
    exception->Demanded);

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:
© 2017 Microsoft