using System; using System.Globalization; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Text; namespace System { /// The exception that is thrown when the file image of a dynamic link library (DLL) or an executable program is invalid. /// 2 // Token: 0x0200063F RID: 1599 [ComVisible(true)] [Serializable] public class BadImageFormatException : SystemException { /// Initializes a new instance of the class. // Token: 0x06003B38 RID: 15160 RVA: 0x000C9D84 File Offset: 0x000C7F84 public BadImageFormatException() : base(Locale.GetText("Format of the executable (.exe) or library (.dll) is invalid.")) { base.HResult = -2147024885; } /// Initializes a new instance of the class with a specified error message. /// The message that describes the error. // Token: 0x06003B39 RID: 15161 RVA: 0x000C9DA4 File Offset: 0x000C7FA4 public BadImageFormatException(string message) : base(message) { base.HResult = -2147024885; } /// Initializes a new instance of the class with serialized data. /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. // Token: 0x06003B3A RID: 15162 RVA: 0x000C9DB8 File Offset: 0x000C7FB8 protected BadImageFormatException(SerializationInfo info, StreamingContext context) : base(info, context) { this.fileName = info.GetString("BadImageFormat_FileName"); this.fusionLog = info.GetString("BadImageFormat_FusionLog"); } /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. // Token: 0x06003B3B RID: 15163 RVA: 0x000C9DF0 File Offset: 0x000C7FF0 public BadImageFormatException(string message, Exception inner) : base(message, inner) { base.HResult = -2147024885; } /// Initializes a new instance of the class with a specified error message and file name. /// A message that describes the error. /// The full name of the file with the invalid image. // Token: 0x06003B3C RID: 15164 RVA: 0x000C9E08 File Offset: 0x000C8008 public BadImageFormatException(string message, string fileName) : base(message) { this.fileName = fileName; base.HResult = -2147024885; } /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. /// The error message that explains the reason for the exception. /// The full name of the file with the invalid image. /// The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception. // Token: 0x06003B3D RID: 15165 RVA: 0x000C9E24 File Offset: 0x000C8024 public BadImageFormatException(string message, string fileName, Exception inner) : base(message, inner) { this.fileName = fileName; base.HResult = -2147024885; } /// Gets the error message and the name of the file that caused this exception. /// A string containing the error message and the name of the file that caused this exception. /// 2 // Token: 0x17000B58 RID: 2904 // (get) Token: 0x06003B3E RID: 15166 RVA: 0x000C9E40 File Offset: 0x000C8040 public override string Message { get { if (this.message == null) { return string.Format(CultureInfo.CurrentCulture, "Could not load file or assembly '{0}' or one of its dependencies. An attempt was made to load a program with an incorrect format.", new object[] { this.fileName }); } return base.Message; } } /// Gets the name of the file that causes this exception. /// The name of the file with the invalid image, or a null reference if no file name was passed to the constructor for the current instance. /// 2 // Token: 0x17000B59 RID: 2905 // (get) Token: 0x06003B3F RID: 15167 RVA: 0x000C9E80 File Offset: 0x000C8080 public string FileName { get { return this.fileName; } } /// Gets the log file that describes why an assembly load failed. /// A String containing errors reported by the assembly cache. /// 2 /// /// /// // Token: 0x17000B5A RID: 2906 // (get) Token: 0x06003B40 RID: 15168 RVA: 0x000C9E88 File Offset: 0x000C8088 [MonoTODO("Probably not entirely correct. fusionLog needs to be set somehow (we are probably missing internal constuctor)")] public string FusionLog { get { return this.fusionLog; } } /// Sets the object with the file name, assembly cache log, and additional exception information. /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. /// The caller does not have the required permission. /// 2 /// /// /// /// // Token: 0x06003B41 RID: 15169 RVA: 0x000C9E90 File Offset: 0x000C8090 public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); info.AddValue("BadImageFormat_FileName", this.fileName); info.AddValue("BadImageFormat_FusionLog", this.fusionLog); } /// Returns the fully qualified name of this exception and possibly the error message, the name of the inner exception, and the stack trace. /// A string containing the fully qualified name of this exception and possibly the error message, the name of the inner exception, and the stack trace. /// 2 /// /// /// // Token: 0x06003B42 RID: 15170 RVA: 0x000C9EC8 File Offset: 0x000C80C8 public override string ToString() { StringBuilder stringBuilder = new StringBuilder(this.GetType().FullName); stringBuilder.AppendFormat(": {0}", this.Message); if (this.fileName != null && this.fileName.Length > 0) { stringBuilder.Append(Environment.NewLine); stringBuilder.AppendFormat("File name: '{0}'", this.fileName); } if (this.InnerException != null) { stringBuilder.AppendFormat(" ---> {0}", this.InnerException); } if (this.StackTrace != null) { stringBuilder.Append(Environment.NewLine); stringBuilder.Append(this.StackTrace); } return stringBuilder.ToString(); } // Token: 0x040017BD RID: 6077 private const int Result = -2147024885; // Token: 0x040017BE RID: 6078 private string fileName; // Token: 0x040017BF RID: 6079 private string fusionLog; } }