Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / mscorlib / system / reflection / targetexception.cs
1 // ==++==
2 // 
3 //   Copyright (c) Microsoft Corporation.  All rights reserved.
4 // 
5 // ==--==
6 ////////////////////////////////////////////////////////////////////////////////
7 ////////////////////////////////////////////////////////////////////////////////
8 //
9 // TargetException is thrown when the target to an Invoke is invalid.  This may
10 // 
11 // <OWNER>Microsoft</OWNER>
12 //    occur because the caller doesn't have access to the member, or the target doesn't
13 //    define the member, etc.
14 //
15 // 
16 //  
17 //
18 namespace System.Reflection {
19     
20     using System;
21     using System.Runtime.Serialization;
22     [Serializable]
23 [System.Runtime.InteropServices.ComVisible(true)]
24 #if FEATURE_CORECLR
25     public class TargetException : Exception {
26 #else
27     public class TargetException : ApplicationException {
28 #endif //FEATURE_CORECLR
29         public TargetException() : base() {
30             SetErrorCode(__HResults.COR_E_TARGET);
31         }
32     
33         public TargetException(String message) : base(message) {
34             SetErrorCode(__HResults.COR_E_TARGET);
35         }
36         
37         public TargetException(String message, Exception inner) : base(message, inner) {
38             SetErrorCode(__HResults.COR_E_TARGET);
39         }
40
41         protected TargetException(SerializationInfo info, StreamingContext context) : base (info, context) {
42         }
43     }
44 }