TargetInvocationException Konstruktorer

Definition

Initierar en ny instans av TargetInvocationException klassen.

Överlagringar

Name Description
TargetInvocationException(Exception)

Initierar en ny instans av TargetInvocationException klassen med en referens till det inre undantaget som är orsaken till det här undantaget.

TargetInvocationException(String, Exception)

Initierar en ny instans av TargetInvocationException klassen med ett angivet felmeddelande och en referens till det inre undantaget som är orsaken till det här undantaget.

TargetInvocationException(Exception)

Källa:
TargetInvocationException.cs
Källa:
TargetInvocationException.cs
Källa:
TargetInvocationException.cs
Källa:
TargetInvocationException.cs
Källa:
TargetInvocationException.cs

Initierar en ny instans av TargetInvocationException klassen med en referens till det inre undantaget som är orsaken till det här undantaget.

public:
 TargetInvocationException(Exception ^ inner);
public TargetInvocationException(Exception inner);
public TargetInvocationException(Exception? inner);
new System.Reflection.TargetInvocationException : Exception -> System.Reflection.TargetInvocationException
Public Sub New (inner As Exception)

Parametrar

inner
Exception

Undantaget som är orsaken till det aktuella undantaget. Om parametern inner inte nullär genereras det aktuella undantaget i ett catch block som hanterar det inre undantaget.

Kommentarer

Ett undantag som genereras som ett direkt resultat av ett tidigare undantag bör innehålla en referens till det tidigare undantaget i InnerException egenskapen. Egenskapen InnerException returnerar samma värde som skickas till konstruktorn, eller null om InnerException egenskapen inte anger det inre undantagsvärdet till konstruktorn.

I följande tabell visas de inledande egenskapsvärdena för en instans av TargetInvocationException.

Fastighet Value
InnerException Den inre undantagsreferensen.
Message Felmeddelandesträngen.

Se även

Gäller för

TargetInvocationException(String, Exception)

Källa:
TargetInvocationException.cs
Källa:
TargetInvocationException.cs
Källa:
TargetInvocationException.cs
Källa:
TargetInvocationException.cs
Källa:
TargetInvocationException.cs

Initierar en ny instans av TargetInvocationException klassen med ett angivet felmeddelande och en referens till det inre undantaget som är orsaken till det här undantaget.

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

Parametrar

message
String

Felmeddelandet som förklarar orsaken till undantaget.

inner
Exception

Undantaget som är orsaken till det aktuella undantaget. Om parametern inner inte nullär genereras det aktuella undantaget i ett catch block som hanterar det inre undantaget.

Kommentarer

Ett undantag som genereras som ett direkt resultat av ett tidigare undantag bör innehålla en referens till det tidigare undantaget i InnerException egenskapen. Egenskapen InnerException returnerar samma värde som skickas till konstruktorn, eller null om InnerException egenskapen inte anger det inre undantagsvärdet till konstruktorn.

I följande tabell visas de inledande egenskapsvärdena för en instans av TargetInvocationException.

Fastighet Value
InnerException Den inre undantagsreferensen.
Message Felmeddelandesträngen.

Se även

Gäller för