1 // Licensed to the .NET Foundation under one or more agreements. 2 // The .NET Foundation licenses this file to you under the MIT license. 3 // See the LICENSE file in the project root for more information. 4 5 using System.Runtime.Serialization; 6 7 namespace System 8 { 9 // TypeAccessException derives from TypeLoadException rather than MemberAccessException because in 10 // pre-v4 releases of the runtime TypeLoadException was used in lieu of a TypeAccessException. 11 [Serializable] 12 [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] 13 public class TypeAccessException : TypeLoadException 14 { TypeAccessException()15 public TypeAccessException() 16 : base(SR.Arg_TypeAccessException) 17 { 18 HResult = HResults.COR_E_TYPEACCESS; 19 } 20 TypeAccessException(string message)21 public TypeAccessException(string message) 22 : base(message) 23 { 24 HResult = HResults.COR_E_TYPEACCESS; 25 } 26 TypeAccessException(string message, Exception inner)27 public TypeAccessException(string message, Exception inner) 28 : base(message, inner) 29 { 30 HResult = HResults.COR_E_TYPEACCESS; 31 } 32 TypeAccessException(SerializationInfo info, StreamingContext context)33 protected TypeAccessException(SerializationInfo info, StreamingContext context) : base(info, context) 34 { 35 } 36 } 37 } 38