Export (0) Print
Expand All

SecurityException.SecurityException(String, AssemblyName, PermissionSet, PermissionSet, MethodInfo, SecurityAction, Object, IPermission, Evidence) Constructor

Initializes a new instance of the SecurityException class for an exception caused by an insufficient grant set.

Namespace: System.Security
Assembly: mscorlib (in mscorlib.dll)

public SecurityException (
	string message,
	AssemblyName assemblyName,
	PermissionSet grant,
	PermissionSet refused,
	MethodInfo method,
	SecurityAction action,
	Object demanded,
	IPermission permThatFailed,
	Evidence evidence
)
public SecurityException (
	String message, 
	AssemblyName assemblyName, 
	PermissionSet grant, 
	PermissionSet refused, 
	MethodInfo method, 
	SecurityAction action, 
	Object demanded, 
	IPermission permThatFailed, 
	Evidence evidence
)
public function SecurityException (
	message : String, 
	assemblyName : AssemblyName, 
	grant : PermissionSet, 
	refused : PermissionSet, 
	method : MethodInfo, 
	action : SecurityAction, 
	demanded : Object, 
	permThatFailed : IPermission, 
	evidence : Evidence
)
Not applicable.

Parameters

message

The error message that explains the reason for the exception.

assemblyName

An AssemblyName that specifies the name of the assembly that caused the exception.

grant

A PermissionSet that represents the permissions granted the assembly.

refused

A PermissionSet that represents the refused permission or permission set.

method

A MethodInfo that represents the method that encountered the exception.

action

One of the SecurityAction values.

demanded

The demanded permission, permission set, or permission set collection.

permThatFailed

An IPermission that represents the permission that failed.

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

Message

The localized error message string specified by message.

FirstPermissionThatFailed

The first permission in the permission set or permission set collection specified by permThatFailed.

GrantedSet

The PermissionSet specified by grant.

Demanded

The demanded security permission, permission set, or permission set collection that failed, specified by demanded.

RefusedSet

The PermissionSet specified by refused.

DenySetInstance

An empty string.

PermitOnlySetInstance

An empty string.

FailedAssemblyInfo

The AssemblyName specified by assemblyName.

Method

The MethodInfo specified by method.

Zone

The SecurityZone value from the Evidence specified by evidence.

Url

The URL from the Evidence specified by evidence.

For an example of the use of a SecurityException constructor, see the example provided for the SecurityException(String,Object,Object,MethodInfo,Object,IPermission) constructor.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft