Initializes a new instance of the ArgumentOutOfRangeException class with a specified message, a parameter name, and a value of the argument.
[Visual Basic] Overloads Public Sub New( _ ByVal parameterName As String, _ ByVal actualValue As Object, _ ByVal message As String _ ) [C#] public ArgumentOutOfRangeException( string parameterName, object actualValue, string message ); [C++] public: ArgumentOutOfRangeException( String* parameterName, Object* actualValue, String* message ); [JScript] public function ArgumentOutOfRangeException( parameterName : String, actualValue : Object, message : String );
Note that this constructor is not used within the base class library. The ActualValue property is provided so that developers can avoid the use of printf's when throwing this exception with an appropriate message text.
The actualValue parameter is an invalid value that was passed to the method and causes this exception to be thrown. This value is stored in the ActualValue property and a string representation is appended to the value of the Message property.
ArgumentOutOfRangeException inherits from the Exception class. This constructor sets the properties of the Exception object as follows:
Property Type | Condition |
---|---|
ActualValue | actualValue |
InnerException | null |
Message | The message string. |
ParamName | The parameter name string. |
ArgumentOutOfRangeException Class | ArgumentOutOfRangeException Members | System Namespace | ArgumentOutOfRangeException Constructor Overload List