BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.ArgumentException

Represents the error that occurs when an argument passed to a method is invalid because it is .

is thrown when a method is invoked and at least one of the passed arguments is and should never be .

behaves identically to . It is provided so that application code can differentiate between exceptions caused by arguments and exceptions caused by non-null arguments. For errors caused by non-null arguments, see .

The following example demonstrates an error that causes the class to throw a exception.

`using System; class ArgumentNullTest { public static void Main() { String[] s = null; String sep = " "; try { String j = String.Join(sep,s); } catch (ArgumentNullException e) { Console.WriteLine("Error: {0}",e); } } }`

The output is

Error: System.ArgumentNullException: Value cannot be null.

Parameter name: value

at System.String.Join(String separator, String[] value)

at ArgumentNullTest.Main()

- Constructor

  Constructs and initializes a new instance of the class.

  This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "Argument cannot be null." This message takes into account the current system culture. The property is initialized to .

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Constructor
  A that contains the name of the parameter that caused the exception. The content of is intended to be understood by humans.

  Constructs and initializes a new instance of the class.

  This constructor initializes the property of the new instance using . The property is initialized to the system-supplied message provided by the constructor that takes no arguments.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  2.0.0.0
  4.0.0.0
- Constructor
  A that contains the name of the parameter that caused the exception. The content of is intended to be understood by humans.
  A that describes the error. The content of is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

  Constructs and initializes a new instance of the class.

  This constructor initializes the property of the new instance using , and the property using . If is , the property is initialized to the system-supplied message provided by the constructor that takes no arguments.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
0 System.Runtime.InteropServices.ComVisible(true)