System.ApplicationException Class

public class ApplicationException : Exception

Base Types

Object
  Exception
    ApplicationException

Assembly

mscorlib

Library

BCL

Summary

ApplicationException is the base class for all exceptions defined by applications.

Description

This class represents application-defined errors detected during the execution of an application. It is provided as means to differentiate between exceptions defined by applications versus 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.]

See Also

System Namespace

Members

ApplicationException Constructors

ApplicationException() Constructor
ApplicationException(System.String) Constructor
ApplicationException(System.String, System.Exception) Constructor


ApplicationException() Constructor

public ApplicationException();

Summary

Constructs and initializes a new instance of the ApplicationException class.

Description

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 .

See Also

System.ApplicationException Class, System Namespace

ApplicationException(System.String) Constructor

public ApplicationException(string message);

Summary

Constructs and initializes a new instance of the ApplicationException class.

Parameters

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.

Description

This constructor initializes the System.ApplicationException.Message property of the new instance using message. If message is null , 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 to null .

See Also

System.ApplicationException Class, System Namespace

ApplicationException(System.String, System.Exception) Constructor

public ApplicationException(string message, Exception innerException);

Summary

Constructs and initializes a new instance of the ApplicationException class.

Parameters

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 .

Description

This constructor initializes the System.ApplicationException.Message property of the new instance using message, and the System.ApplicationException.InnerException property using innerException. If message is null , 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.]

See Also

System.ApplicationException Class, System Namespace