public class ApplicationException : Exception
Object
Exception
ApplicationException
mscorlib
BCL
ApplicationException is the base class for all exceptions defined by applications.
This class represents application-defined errors detected during the execution of an application. It is provided as a means of differentiating between exceptions defined by applications and exceptions defined by the system.[Note: For more information on exceptions defined by the system, see SystemException .]
[Note: ApplicationException does not provide information as to the cause of the exception. In most scenarios, instances of this class should not be thrown. In cases where this class is instantiated, a human-readable message describing the error should be passed to the constructor.]
System Namespace
ApplicationException Constructors
ApplicationException() Constructor
ApplicationException(System.String) Constructor
ApplicationException(System.String, System.Exception) Constructor
public ApplicationException();
Constructs and initializes a new instance of the ApplicationException class.
This constructor initializes the System.ApplicationException.Message property of the new instance to a system-supplied message that describes the error, such as "An application error has occurred." This message takes into account the current system culture.The System.ApplicationException.InnerException property is initialized to
null
.
System.ApplicationException Class, System Namespace
public ApplicationException(string message);
Constructs and initializes a new instance of the ApplicationException class.
- message
- A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
This constructor initializes the System.ApplicationException.Message property of the new instance using message. If message isnull
, the System.ApplicationException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments. The System.ApplicationException.InnerException property is initialized tonull
.
System.ApplicationException Class, System Namespace
public ApplicationException(string message, Exception innerException);
Constructs and initializes a new instance of the ApplicationException class.
- message
- A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
- innerException
- An instance of Exception that is the cause of the current Exception. If innerException is non-null, then the current Exception was raised in a catch block handling innerException .
This constructor initializes the System.ApplicationException.Message property of the new instance using message, and the System.ApplicationException.InnerException property using innerException. If message isnull
, the System.ApplicationException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments.[Note: For information on inner exceptions, see System.Exception.InnerException.]
System.ApplicationException Class, System Namespace