3 // Copyright (c) Microsoft Corporation. All rights reserved.
6 ////////////////////////////////////////////////////////////////////////////////
7 ////////////////////////////////////////////////////////////////////////////////
9 // TargetInvocationException is used to report an exception that was thrown
11 // <OWNER>Microsoft</OWNER>
12 // by the target of an invocation.
17 namespace System.Reflection {
21 using System.Runtime.Serialization;
23 [System.Runtime.InteropServices.ComVisible(true)]
25 public sealed class TargetInvocationException : Exception {
27 public sealed class TargetInvocationException : ApplicationException {
28 #endif //FEATURE_CORECLR
29 // This exception is not creatable without specifying the
31 private TargetInvocationException()
32 : base(Environment.GetResourceString("Arg_TargetInvocationException")) {
33 SetErrorCode(__HResults.COR_E_TARGETINVOCATION);
36 // This is called from within the runtime.
37 private TargetInvocationException(String message) : base(message) {
38 SetErrorCode(__HResults.COR_E_TARGETINVOCATION);
41 public TargetInvocationException(System.Exception inner)
42 : base(Environment.GetResourceString("Arg_TargetInvocationException"), inner) {
43 SetErrorCode(__HResults.COR_E_TARGETINVOCATION);
46 public TargetInvocationException(String message, Exception inner) : base(message, inner) {
47 SetErrorCode(__HResults.COR_E_TARGETINVOCATION);
50 internal TargetInvocationException(SerializationInfo info, StreamingContext context) : base (info, context) {