Class ArgumentNullException
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.
Inherited Members
Namespace: System
Assembly: mscorlib.dll
Syntax
public class ArgumentNullException : ArgumentException
Constructors
ArgumentNullException()
Initializes a new instance of the ArgumentNullException class.
Declaration
public ArgumentNullException()
ArgumentNullException(string)
Initializes a new instance of the ArgumentNullException class with the name of the parameter that causes this exception.
Declaration
public ArgumentNullException(string argument)
Parameters
Type | Name | Description |
---|---|---|
string | argument | The name of the parameter that caused the exception. |
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.
Declaration
public ArgumentNullException(string paramName, string message)
Parameters
Type | Name | Description |
---|---|---|
string | paramName | The name of the parameter that caused the exception. |
string | message | A message that describes the error. |