InvalidProgramException.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. **
  6. **
  7. **
  8. ** Purpose: The exception class for programs with invalid IL or bad metadata.
  9. **
  10. **
  11. =============================================================================*/
  12. using System.Runtime.Serialization;
  13. namespace System
  14. {
  15. [Serializable]
  16. [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
  17. public sealed class InvalidProgramException : SystemException
  18. {
  19. public InvalidProgramException()
  20. : base(SR.InvalidProgram_Default)
  21. {
  22. HResult = HResults.COR_E_INVALIDPROGRAM;
  23. }
  24. public InvalidProgramException(string message)
  25. : base(message)
  26. {
  27. HResult = HResults.COR_E_INVALIDPROGRAM;
  28. }
  29. public InvalidProgramException(string message, Exception inner)
  30. : base(message, inner)
  31. {
  32. HResult = HResults.COR_E_INVALIDPROGRAM;
  33. }
  34. internal InvalidProgramException(SerializationInfo info, StreamingContext context) : base(info, context) { }
  35. }
  36. }