ArgumentNullException Class

The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.

Syntax

Declaration

[ComVisible(true)]
[Serializable]
public class ArgumentNullException : ArgumentException, _Exception, ISerializable

Inheritance Hierarchy

Inherited Members

System.ArgumentException

,

System.Exception

, , , , , , ,

System.Object

, , , , ,

Constructors summary

Initializes a new instance of the ArgumentNullException class.

Initializes a new instance of the ArgumentNullException class with the name of the parameter that causes this exception.

Initializes a new instance of the ArgumentNullException class with a specified error message and the exception that is the cause of this exception.

Initializes an instance of the ArgumentNullException class with a specified error message and the name of the parameter that causes this exception.

Constructors

  • ArgumentNullException()

    Initializes a new instance of the ArgumentNullException class.

    public ArgumentNullException()
  • ArgumentNullException(String)

    Initializes a new instance of the ArgumentNullException class with the name of the parameter that causes this exception.

    public ArgumentNullException(string paramName)

    Parameters

    • paramName

      The name of the parameter that caused the exception.

  • ArgumentNullException(String, Exception)

    Initializes a new instance of the ArgumentNullException class with a specified error message and the exception that is the cause of this exception.

    public ArgumentNullException(string message, Exception innerException)

    Parameters

    • message

      The error message that explains the reason for this exception.

    • innerException

      The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.

  • ArgumentNullException(String, String)

    Initializes an instance of the ArgumentNullException class with a specified error message and the name of the parameter that causes this exception.

    public ArgumentNullException(string paramName, string message)

    Parameters

    • paramName

      The name of the parameter that caused the exception.

    • message

      A message that describes the error.

Details

Namespace

System

Assembly

System.Runtime.dll

See Also