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.
System.Object
System.Exception
System.SystemException
System.ArgumentException
System.ArgumentNullException
[Visual Basic] <Serializable> Public Class ArgumentNullException Inherits ArgumentException [C#] [Serializable] public class ArgumentNullException : ArgumentException [C++] [Serializable] public __gc class ArgumentNullException : public ArgumentException [JScript] public Serializable 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.
Remarks
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.
Requirements
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