This documentation is archived and is not being maintained.

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.

For a list of all members of this type, see ArgumentNullException Members.


[Visual Basic]
Public Class ArgumentNullException
   Inherits ArgumentException
public class ArgumentNullException : ArgumentException
public __gc class ArgumentNullException : public ArgumentException
class ArgumentNullException extends ArgumentException

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


ArgumentNullException is thrown when a method is invoked and at least one of the passed arguments is a null reference (Nothing in Visual Basic) and should never be null.

ArgumentNullException behaves identically to ArgumentException. It is provided so that application code can differentiate between exceptions caused by null arguments and exceptions caused by arguments that are not null. For errors caused by arguments that are not null, see ArgumentOutOfRangeException.

ArgumentNullException uses the HRESULT E_POINTER, which has the value 0x80004003.

For a list of initial property values for an instance of ArgumentNullException, see the ArgumentNullException constructors.


Namespace: System

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: Mscorlib (in Mscorlib.dll)

See Also

ArgumentNullException Members | System Namespace | Exception | Handling and Throwing Exceptions