Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

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.

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.

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.

Community Additions

ADD
Show:
© 2015 Microsoft