Compartir a través de


Troubleshooting Exceptions: System.ArgumentNullException 

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

Associated Tips

  • Check arguments to make sure they are not null (Nothing in Visual Basic).
    A null reference is a reference to an object that does not exist, often because no instance of the object has been programmatically created.

Remarks

ArgumentNullException behaves identically to ArgumentException. It is provided so 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 Troubleshooting Exceptions: System.ArgumentOutOfRangeException.

See Also

Tasks

How to: Find Out More About an Exception with the Exception Assistant

Reference

Visual J# Exception Handling for the Debugger
Visual J# Exception Hierarchies
ArgumentNullException