RuntimeInfrastructure mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.SystemException

Represents the error that occurs when an attempt is made to load a from a file with an invalid file image.

This exception is thrown when the file image of an executable program is invalid. For example, this exception is thrown when unmanaged code is passed to for loading.

The following example demonstrates an attempt to load an unmanaged executable, which causes the system to throw a exception. The name of the unmanaged executable is "calc".

`using System; using System.Reflection; public class BadImageExample { public static void Main() { try { Assembly a = Assembly.Load("calc"); } catch (BadImageFormatException e) { Console.WriteLine("Caught: {0}", e.Message); } } }`

The output is

Caught: The format of the file 'calc' is invalid.

- Constructor

  Constructs and initializes a new instance of the class.

  This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "Format of the executable or library is invalid." This message takes into account the current system culture.

  The and the properties of the new instance are initialized to .

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Constructor
  A that describes the error. The content of is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

  Constructs and initializes a new instance of the class.

  This constructor initializes the property of the new instance using . If is , the property is initialized to the system-supplied message provided by the constructor that takes no arguments.

  The and the properties of the new instance are initialized to .

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Constructor
  A that describes the error. The content of is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
  An instance of that is the cause of the current exception. If is non-null, then the current exception was raised in a catch block handling .

  Constructs and initializes a new instance of the class.

  This constructor initializes the property of the new instance using and the property using . If is , the property is initialized to the system-supplied message provided by the constructor that takes no arguments.

  The property of the new instance is initialized to .

  For more information on inner exceptions, see .

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Constructor
  A that describes the error. The content of is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
  A containing the name of the file with the invalid image.

  Constructs and initializes a new instance of the class.

  This constructor initializes the property of the new instance using and the property using . If is , the property is initialized to the system-supplied message provided by the constructor that takes no arguments.

  The property of the new instance is initialized to .

  If the parameter is , the property is set to , the property does not contain the name of the file, and the method does not return the name of the file with the invalid image.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Constructor
  A that describes the error. The content of is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
  A containing the name of the file with the invalid image.
  An instance of that is the cause of the current exception. If is non-null, then the current exception was raised in a catch block handling .
  To be added.

  Constructs and initializes a new instance of the class.

  This constructor initializes the property of the new instance using , the property using , and the property using . If is , the property is initialized to the system-supplied message provided by the constructor that takes no arguments.

  If the parameter is , the property is set to , the property does not contain the name of the file, and the method does not return the name of the file with the invalid image.

  For more information on inner exceptions, see .

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.String

  Gets the name of the file with the invalid image.

  A containing the name of the file with the invalid image, or if no file name was passed to the constructor for the current instance.

  This property is read-only.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.String To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String

  Gets a that describes the error that caused the current exception.

  A containing the error description.

  If no message was supplied to the constructor for the current exception, this property returns a system-supplied error message. If the property is not , the message includes the file name.

  This property is read-only.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.String

  Returns a representation of the value of the current exception.

  A representation of the current exception.

  The string representation returned by this method includes the name of the exception, the value of the property, the result of calling on the inner exception, the value of the property, and the result of calling . If any of these members is , its value is not included in the returned string.

  This method overrides .

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
0 System.Runtime.InteropServices.ComVisible(true)