DirectoryNotFoundException Class

The exception that is thrown when part of a file or directory cannot be found.

Syntax

Declaration

[Serializable]
[ComVisible(true)]
public class DirectoryNotFoundException : IOException, ISerializable, _Exception

Inheritance Hierarchy

Constructors summary

Initializes a new instance of the DirectoryNotFoundException class with its message string set to a system-supplied message and its HRESULT set to COR_E_DIRECTORYNOTFOUND.

Initializes a new instance of the DirectoryNotFoundException class with its message string set to message and its HRESULT set to COR_E_DIRECTORYNOTFOUND.

Initializes a new instance of the DirectoryNotFoundException class with a specified error message and a reference to the inner exception that is the cause of this exception.

Constructors

  • DirectoryNotFoundException()

    Initializes a new instance of the DirectoryNotFoundException class with its message string set to a system-supplied message and its HRESULT set to COR_E_DIRECTORYNOTFOUND.

    public DirectoryNotFoundException()
  • DirectoryNotFoundException(String)

    Initializes a new instance of the DirectoryNotFoundException class with its message string set to message and its HRESULT set to COR_E_DIRECTORYNOTFOUND.

    public DirectoryNotFoundException(string message)

    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.

  • DirectoryNotFoundException(String, Exception)

    Initializes a new instance of the DirectoryNotFoundException class with a specified error message and a reference to the inner exception that is the cause of this exception.

    public DirectoryNotFoundException(string message, Exception innerException)

    Parameters

    • message

      The error message that explains the reason for the exception.

    • innerException

      The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception.

Details

Namespace

System.IO

Assembly

System.Runtime.dll

See Also