Редагувати

Поділитися через


TargetParameterCountException Constructors

Definition

Initializes a new instance of the TargetParameterCountException class.

Overloads

TargetParameterCountException()

Initializes a new instance of the TargetParameterCountException class with an empty message string and the root cause of the exception.

TargetParameterCountException(String)

Initializes a new instance of the TargetParameterCountException class with its message string set to the given message and the root cause exception.

TargetParameterCountException(String, Exception)

Initializes a new instance of the TargetParameterCountException class with a specified error message and a reference to the inner exception that is the cause of this exception.

TargetParameterCountException()

Source:
TargetParameterCountException.cs
Source:
TargetParameterCountException.cs
Source:
TargetParameterCountException.cs

Initializes a new instance of the TargetParameterCountException class with an empty message string and the root cause of the exception.

public:
 TargetParameterCountException();
public TargetParameterCountException ();
Public Sub New ()

Remarks

TargetParameterCountException inherits from Exception. This constructor sets the properties of the Exception object as shown in the following table.

Property Value
InnerException null
Message The empty string ("").

Applies to

TargetParameterCountException(String)

Source:
TargetParameterCountException.cs
Source:
TargetParameterCountException.cs
Source:
TargetParameterCountException.cs

Initializes a new instance of the TargetParameterCountException class with its message string set to the given message and the root cause exception.

public:
 TargetParameterCountException(System::String ^ message);
public TargetParameterCountException (string message);
public TargetParameterCountException (string? message);
new System.Reflection.TargetParameterCountException : string -> System.Reflection.TargetParameterCountException
Public Sub New (message As String)

Parameters

message
String

A String describing the reason this exception was thrown.

Remarks

TargetParameterCountException inherits from Exception. This constructor sets the properties of the Exception object as shown in the following table.

Property Value
InnerException null
Message The message string.

Applies to

TargetParameterCountException(String, Exception)

Source:
TargetParameterCountException.cs
Source:
TargetParameterCountException.cs
Source:
TargetParameterCountException.cs

Initializes a new instance of the TargetParameterCountException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public:
 TargetParameterCountException(System::String ^ message, Exception ^ inner);
public TargetParameterCountException (string message, Exception inner);
public TargetParameterCountException (string? message, Exception? inner);
new System.Reflection.TargetParameterCountException : string * Exception -> System.Reflection.TargetParameterCountException
Public Sub New (message As String, inner As Exception)

Parameters

message
String

The error message that explains the reason for the exception.

inner
Exception

The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception.

Remarks

An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. The InnerException property returns the same value that is passed into the constructor, or null if the InnerException property does not supply the inner exception value to the constructor.

The following table shows the initial property values for an instance of TargetParameterCountException.

Property Value
InnerException The inner exception reference.
Message The error message string.

See also

Applies to