SecurityException Constructor (String, Object, Object, MethodInfo, Object, IPermission)
![]() |
---|
The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience. |
Initializes a new instance of the SecurityException class for an exception caused by a Deny on the stack.
Assembly: mscorlib (in mscorlib.dll)
new : message:string * deny:Object * permitOnly:Object * method:MethodInfo * demanded:Object * permThatFailed:IPermission -> SecurityException
Parameters
- message
-
Type:
System.String
The error message that explains the reason for the exception.
- deny
-
Type:
System.Object
The denied permission or permission set.
- permitOnly
-
Type:
System.Object
The permit-only permission or permission set.
- method
-
Type:
System.Reflection.MethodInfo
A MethodInfo that identifies the method that encountered the exception.
- demanded
-
Type:
System.Object
The demanded permission, permission set, or permission set collection.
- permThatFailed
-
Type:
System.Security.IPermission
An IPermission that identifies the permission that failed.
Use this constructor if a frame that contains a Deny caused the demand failure. The following table shows the property values set by this constructor.
Property | Value |
---|---|
The localized error message string specified by message. | |
The first permission in the permission set or permission set collection specified by permThatFailed. | |
An empty string. | |
The security permission, permission set, or permission set collection specified by demanded. | |
An empty string. | |
The denied security permission, permission set, or permission set collection specified by deny. | |
The permission, permission set, or permission set collection specified by permitOnly. | |
null. | |
The MethodInfo specified by method. | |
An empty string. |
Available since 2.0