SecurityException Constructor (String, AssemblyName, PermissionSet, PermissionSet, MethodInfo, SecurityAction, Object, IPermission, Evidence)
![]() |
---|
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 an insufficient grant set.
Assembly: mscorlib (in mscorlib.dll)
new : message:string * assemblyName:AssemblyName * grant:PermissionSet * refused:PermissionSet * method:MethodInfo * action:SecurityAction * demanded:Object * permThatFailed:IPermission * evidence:Evidence -> SecurityException
Parameters
- message
-
Type:
System.String
The error message that explains the reason for the exception.
- assemblyName
-
Type:
System.Reflection.AssemblyName
An AssemblyName that specifies the name of the assembly that caused the exception.
- grant
-
Type:
System.Security.PermissionSet
A PermissionSet that represents the permissions granted the assembly.
- refused
-
Type:
System.Security.PermissionSet
A PermissionSet that represents the refused permission or permission set.
- method
-
Type:
System.Reflection.MethodInfo
A MethodInfo that represents the method that encountered the exception.
- action
-
Type:
System.Security.Permissions.SecurityAction
One of the SecurityAction values.
- demanded
-
Type:
System.Object
The demanded permission, permission set, or permission set collection.
- permThatFailed
-
Type:
System.Security.IPermission
An IPermission that represents the permission that failed.
- evidence
-
Type:
System.Security.Policy.Evidence
The Evidence for the assembly that caused the exception.
Use this constructor to throw an exception when the grant set caused the failure of the demand.
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. | |
The PermissionSet specified by grant. | |
The demanded security permission, permission set, or permission set collection that failed, specified by demanded. | |
The PermissionSet specified by refused. | |
An empty string. | |
An empty string. | |
The AssemblyName specified by assemblyName. | |
The MethodInfo specified by method. | |
The SecurityZone value from the Evidence specified by evidence. | |
The URL from the Evidence specified by evidence. |
Available since 2.0