mscorlib(4.0.0.0) API with additions
System.Security.SecurityException Class Reference

The exception that is thrown when a security error is detected. More...

Inheritance diagram for System.Security.SecurityException:
[legend]
Collaboration diagram for System.Security.SecurityException:
[legend]

Public Member Functions

 SecurityException ()
 Initializes a new instance of the T:System.Security.SecurityException class with default properties. More...
 
 SecurityException (string message)
 Initializes a new instance of the T:System.Security.SecurityException class with a specified error message. More...
 
 SecurityException (string message, Type type)
 Initializes a new instance of the T:System.Security.SecurityException class with a specified error message and the permission type that caused the exception to be thrown. More...
 
 SecurityException (string message, Type type, string state)
 Initializes a new instance of the T:System.Security.SecurityException class with a specified error message, the permission type that caused the exception to be thrown, and the permission state. More...
 
 SecurityException (string message, Exception inner)
 Initializes a new instance of the T:System.Security.SecurityException class with a specified error message and a reference to the inner exception that is the cause of this exception. More...
 
 SecurityException (string message, AssemblyName assemblyName, PermissionSet grant, PermissionSet refused, MethodInfo method, SecurityAction action, object demanded, IPermission permThatFailed, Evidence evidence)
 Initializes a new instance of the T:System.Security.SecurityException class for an exception caused by an insufficient grant set. More...
 
 SecurityException (string message, object deny, object permitOnly, MethodInfo method, object demanded, IPermission permThatFailed)
 Initializes a new instance of the T:System.Security.SecurityException class for an exception caused by a Deny on the stack. More...
 
override string ToString ()
 Returns a representation of the current T:System.Security.SecurityException. More...
 
override void GetObjectData (SerializationInfo info, StreamingContext context)
 Sets the T:System.Runtime.Serialization.SerializationInfo with information about the T:System.Security.SecurityException. More...
 
- Public Member Functions inherited from System.SystemException
 SystemException ()
 Initializes a new instance of the T:System.SystemException class. More...
 
 SystemException (string message)
 Initializes a new instance of the T:System.SystemException class with a specified error message. More...
 
 SystemException (string message, Exception innerException)
 Initializes a new instance of the T:System.SystemException class with a specified error message and a reference to the inner exception that is the cause of this exception. More...
 
- Public Member Functions inherited from System.Exception
 Exception ()
 Initializes a new instance of the T:System.Exception class. More...
 
 Exception (string message)
 Initializes a new instance of the T:System.Exception class with a specified error message. More...
 
 Exception (string message, Exception innerException)
 Initializes a new instance of the T:System.Exception class with a specified error message and a reference to the inner exception that is the cause of this exception. More...
 
virtual Exception GetBaseException ()
 When overridden in a derived class, returns the T:System.Exception that is the root cause of one or more subsequent exceptions. More...
 
override string ToString ()
 Creates and returns a string representation of the current exception. More...
 
new Type GetType ()
 Gets the runtime type of the current instance. More...
 
- Public Member Functions inherited from System.Runtime.InteropServices._Exception
new bool Equals (object obj)
 Provides COM objects with version-independent access to the M:System.Object.Equals(System.Object) method. More...
 
new int GetHashCode ()
 Provides COM objects with version-independent access to the M:System.Object.GetHashCode method. More...
 

Protected Member Functions

 SecurityException (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the T:System.Security.SecurityException class with serialized data. More...
 
- Protected Member Functions inherited from System.SystemException
 SystemException (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the T:System.SystemException class with serialized data. More...
 
- Protected Member Functions inherited from System.Exception
 Exception (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the T:System.Exception class with serialized data. More...
 

Properties

SecurityAction Action [get, set]
 Gets or sets the security action that caused the exception. More...
 
Type PermissionType [get, set]
 Gets or sets the type of the permission that failed. More...
 
IPermission FirstPermissionThatFailed [get, set]
 Gets or sets the first permission in a permission set or permission set collection that failed the demand. More...
 
string PermissionState [get, set]
 Gets or sets the state of the permission that threw the exception. More...
 
object Demanded [get, set]
 Gets or sets the demanded security permission, permission set, or permission set collection that failed. More...
 
string GrantedSet [get, set]
 Gets or sets the granted permission set of the assembly that caused the T:System.Security.SecurityException. More...
 
string RefusedSet [get, set]
 Gets or sets the refused permission set of the assembly that caused the T:System.Security.SecurityException. More...
 
object DenySetInstance [get, set]
 Gets or sets the denied security permission, permission set, or permission set collection that caused a demand to fail. More...
 
object PermitOnlySetInstance [get, set]
 Gets or sets the permission, permission set, or permission set collection that is part of the permit-only stack frame that caused a security check to fail. More...
 
AssemblyName FailedAssemblyInfo [get, set]
 Gets or sets information about the failed assembly. More...
 
MethodInfo Method [get, set]
 Gets or sets the information about the method associated with the exception. More...
 
SecurityZone Zone [get, set]
 Gets or sets the zone of the assembly that caused the exception. More...
 
string Url [get, set]
 Gets or sets the URL of the assembly that caused the exception. More...
 
- Properties inherited from System.Exception
virtual string Message [get]
 Gets a message that describes the current exception. More...
 
virtual IDictionary Data [get]
 Gets a collection of key/value pairs that provide additional user-defined information about the exception. More...
 
Exception InnerException [get]
 Gets the T:System.Exception instance that caused the current exception. More...
 
MethodBase TargetSite [get]
 Gets the method that throws the current exception. More...
 
virtual string StackTrace [get]
 Gets a string representation of the immediate frames on the call stack. More...
 
virtual string HelpLink [get, set]
 Gets or sets a link to the help file associated with this exception. More...
 
virtual string Source [get, set]
 Gets or sets the name of the application or the object that causes the error. More...
 
int HResult [get, protected set]
 Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. More...
 
EventHandler< SafeSerializationEventArgsSerializeObjectState
 Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. More...
 
- Properties inherited from System.Runtime.InteropServices._Exception
string Message [get]
 Provides COM objects with version-independent access to the P:System.Exception.Message property. More...
 
string StackTrace [get]
 Provides COM objects with version-independent access to the P:System.Exception.StackTrace property. More...
 
string HelpLink [get, set]
 Provides COM objects with version-independent access to the P:System.Exception.HelpLink property. More...
 
string Source [get, set]
 Provides COM objects with version-independent access to the P:System.Exception.Source property. More...
 
Exception InnerException [get]
 Provides COM objects with version-independent access to the P:System.Exception.InnerException property. More...
 
MethodBase TargetSite [get]
 Provides COM objects with version-independent access to the P:System.Exception.TargetSite property. More...
 

Detailed Description

The exception that is thrown when a security error is detected.

Definition at line 19 of file SecurityException.cs.

Constructor & Destructor Documentation

◆ SecurityException() [1/8]

System.Security.SecurityException.SecurityException ( )

Initializes a new instance of the T:System.Security.SecurityException class with default properties.

Definition at line 364 of file SecurityException.cs.

◆ SecurityException() [2/8]

System.Security.SecurityException.SecurityException ( string  message)

Initializes a new instance of the T:System.Security.SecurityException class with a specified error message.

Parameters
messageThe error message that explains the reason for the exception.

Definition at line 373 of file SecurityException.cs.

◆ SecurityException() [3/8]

System.Security.SecurityException.SecurityException ( string  message,
Type  type 
)

Initializes a new instance of the T:System.Security.SecurityException class with a specified error message and the permission type that caused the exception to be thrown.

Parameters
messageThe error message that explains the reason for the exception.
typeThe type of the permission that caused the exception to be thrown.

Definition at line 383 of file SecurityException.cs.

◆ SecurityException() [4/8]

System.Security.SecurityException.SecurityException ( string  message,
Type  type,
string  state 
)

Initializes a new instance of the T:System.Security.SecurityException class with a specified error message, the permission type that caused the exception to be thrown, and the permission state.

Parameters
messageThe error message that explains the reason for the exception.
typeThe type of the permission that caused the exception to be thrown.
stateThe state of the permission that caused the exception to be thrown.

Definition at line 396 of file SecurityException.cs.

◆ SecurityException() [5/8]

System.Security.SecurityException.SecurityException ( string  message,
Exception  inner 
)

Initializes a new instance of the T:System.Security.SecurityException class with a specified error message and a reference to the inner exception that is the cause of this exception.

Parameters
messageThe error message that explains the reason for the exception.
innerThe exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception.

Definition at line 409 of file SecurityException.cs.

◆ SecurityException() [6/8]

System.Security.SecurityException.SecurityException ( SerializationInfo  info,
StreamingContext  context 
)
protected

Initializes a new instance of the T:System.Security.SecurityException class with serialized data.

Parameters
infoThe object that holds the serialized object data.
contextThe contextual information about the source or destination.
Exceptions
T:System.ArgumentNullExceptioninfo is null.

Definition at line 453 of file SecurityException.cs.

◆ SecurityException() [7/8]

System.Security.SecurityException.SecurityException ( string  message,
AssemblyName  assemblyName,
PermissionSet  grant,
PermissionSet  refused,
MethodInfo  method,
SecurityAction  action,
object  demanded,
IPermission  permThatFailed,
Evidence  evidence 
)

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

Parameters
messageThe error message that explains the reason for the exception.
assemblyNameAn T:System.Reflection.AssemblyName that specifies the name of the assembly that caused the exception.
grantA T:System.Security.PermissionSet that represents the permissions granted the assembly.
refusedA T:System.Security.PermissionSet that represents the refused permission or permission set.
methodA T:System.Reflection.MethodInfo that represents the method that encountered the exception.
actionOne of the T:System.Security.Permissions.SecurityAction values.
demandedThe demanded permission, permission set, or permission set collection.
permThatFailedAn T:System.Security.IPermission that represents the permission that failed.
evidenceThe T:System.Security.Policy.Evidence for the assembly that caused the exception.

Definition at line 503 of file SecurityException.cs.

◆ SecurityException() [8/8]

System.Security.SecurityException.SecurityException ( string  message,
object  deny,
object  permitOnly,
MethodInfo  method,
object  demanded,
IPermission  permThatFailed 
)

Initializes a new instance of the T:System.Security.SecurityException class for an exception caused by a Deny on the stack.

Parameters
messageThe error message that explains the reason for the exception.
denyThe denied permission or permission set.
permitOnlyThe permit-only permission or permission set.
methodA T:System.Reflection.MethodInfo that identifies the method that encountered the exception.
demandedThe demanded permission, permission set, or permission set collection.
permThatFailedAn T:System.Security.IPermission that identifies the permission that failed.

Definition at line 547 of file SecurityException.cs.

Member Function Documentation

◆ GetObjectData()

override void System.Security.SecurityException.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)
virtual

Sets the T:System.Runtime.Serialization.SerializationInfo with information about the T:System.Security.SecurityException.

Parameters
infoThe T:System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown.
contextThe T:System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination.
Exceptions
T:System.ArgumentNullExceptionThe info parameter is null.

Reimplemented from System.Exception.

Definition at line 660 of file SecurityException.cs.

◆ ToString()

override string System.Security.SecurityException.ToString ( )

Returns a representation of the current T:System.Security.SecurityException.

Returns
A string representation of the current T:System.Security.SecurityException.

Implements System.Runtime.InteropServices._Exception.

Definition at line 650 of file SecurityException.cs.

Property Documentation

◆ Action

SecurityAction System.Security.SecurityException.Action
getset

Gets or sets the security action that caused the exception.

Returns
One of the T:System.Security.Permissions.SecurityAction values.

Definition at line 78 of file SecurityException.cs.

◆ Demanded

object System.Security.SecurityException.Demanded
getset

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

Returns
A permission, permission set, or permission set collection object.

Definition at line 152 of file SecurityException.cs.

◆ DenySetInstance

object System.Security.SecurityException.DenySetInstance
getset

Gets or sets the denied security permission, permission set, or permission set collection that caused a demand to fail.

Returns
A permission, permission set, or permission set collection object.

Definition at line 201 of file SecurityException.cs.

◆ FailedAssemblyInfo

AssemblyName System.Security.SecurityException.FailedAssemblyInfo
getset

Gets or sets information about the failed assembly.

Returns
An T:System.Reflection.AssemblyName that identifies the failed assembly.

Definition at line 235 of file SecurityException.cs.

◆ FirstPermissionThatFailed

IPermission System.Security.SecurityException.FirstPermissionThatFailed
getset

Gets or sets the first permission in a permission set or permission set collection that failed the demand.

Returns
An T:System.Security.IPermission object representing the first permission that failed.

Definition at line 119 of file SecurityException.cs.

◆ GrantedSet

string System.Security.SecurityException.GrantedSet
getset

Gets or sets the granted permission set of the assembly that caused the T:System.Security.SecurityException.

Returns
The XML representation of the granted set of the assembly.

Definition at line 168 of file SecurityException.cs.

◆ Method

MethodInfo System.Security.SecurityException.Method
getset

Gets or sets the information about the method associated with the exception.

Returns
A T:System.Reflection.MethodInfo object describing the method.

Definition at line 252 of file SecurityException.cs.

◆ PermissionState

string System.Security.SecurityException.PermissionState
getset

Gets or sets the state of the permission that threw the exception.

Returns
The state of the permission at the time the exception was thrown.

Definition at line 135 of file SecurityException.cs.

◆ PermissionType

Type System.Security.SecurityException.PermissionType
getset

Gets or sets the type of the permission that failed.

Returns
The type of the permission that failed.

Definition at line 92 of file SecurityException.cs.

◆ PermitOnlySetInstance

object System.Security.SecurityException.PermitOnlySetInstance
getset

Gets or sets the permission, permission set, or permission set collection that is part of the permit-only stack frame that caused a security check to fail.

Returns
A permission, permission set, or permission set collection object.

Definition at line 218 of file SecurityException.cs.

◆ RefusedSet

string System.Security.SecurityException.RefusedSet
getset

Gets or sets the refused permission set of the assembly that caused the T:System.Security.SecurityException.

Returns
The XML representation of the refused permission set of the assembly.

Definition at line 184 of file SecurityException.cs.

◆ Url

string System.Security.SecurityException.Url
getset

Gets or sets the URL of the assembly that caused the exception.

Returns
A URL that identifies the location of the assembly.

Definition at line 287 of file SecurityException.cs.

◆ Zone

SecurityZone System.Security.SecurityException.Zone
getset

Gets or sets the zone of the assembly that caused the exception.

Returns
One of the T:System.Security.SecurityZone values that identifies the zone of the assembly that caused the exception.

Definition at line 273 of file SecurityException.cs.


The documentation for this class was generated from the following file: