BadImageFormatException BadImageFormatException BadImageFormatException BadImageFormatException Constructors

Definition

Overloads

BadImageFormatException() BadImageFormatException() BadImageFormatException()

Initializes a new instance of the BadImageFormatException class.

BadImageFormatException(String) BadImageFormatException(String) BadImageFormatException(String) BadImageFormatException(String)

Initializes a new instance of the BadImageFormatException class with a specified error message.

BadImageFormatException(SerializationInfo, StreamingContext) BadImageFormatException(SerializationInfo, StreamingContext) BadImageFormatException(SerializationInfo, StreamingContext) BadImageFormatException(SerializationInfo, StreamingContext)

Initializes a new instance of the BadImageFormatException class with serialized data.

BadImageFormatException(String, Exception) BadImageFormatException(String, Exception) BadImageFormatException(String, Exception) BadImageFormatException(String, Exception)

Initializes a new instance of the BadImageFormatException class with a specified error message and a reference to the inner exception that is the cause of this exception.

BadImageFormatException(String, String) BadImageFormatException(String, String) BadImageFormatException(String, String) BadImageFormatException(String, String)

Initializes a new instance of the BadImageFormatException class with a specified error message and file name.

BadImageFormatException(String, String, Exception) BadImageFormatException(String, String, Exception) BadImageFormatException(String, String, Exception) BadImageFormatException(String, String, Exception)

Initializes a new instance of the BadImageFormatException class with a specified error message and a reference to the inner exception that is the cause of this exception.

BadImageFormatException() BadImageFormatException() BadImageFormatException()

Initializes a new instance of the BadImageFormatException class.

public:
 BadImageFormatException();
public BadImageFormatException ();
Public Sub New ()

Remarks

This constructor initializes the Message 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 following table shows the initial property values for an instance of BadImageFormatException.

Property Value
InnerException A null reference (Nothing in Visual Basic).
Message The localized error message string.

BadImageFormatException(String) BadImageFormatException(String) BadImageFormatException(String) BadImageFormatException(String)

Initializes a new instance of the BadImageFormatException class with a specified error message.

public:
 BadImageFormatException(System::String ^ message);
public BadImageFormatException (string message);
new BadImageFormatException : string -> BadImageFormatException
Public Sub New (message As String)

Parameters

message
String String String String

The message that describes the error.

Remarks

The content of the message parameter 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.

The following table shows the initial property values for an instance of BadImageFormatException.

Property Value
InnerException A null reference (Nothing in Visual Basic).
Message The error message string.

BadImageFormatException(SerializationInfo, StreamingContext) BadImageFormatException(SerializationInfo, StreamingContext) BadImageFormatException(SerializationInfo, StreamingContext) BadImageFormatException(SerializationInfo, StreamingContext)

Initializes a new instance of the BadImageFormatException class with serialized data.

protected:
 BadImageFormatException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected BadImageFormatException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new BadImageFormatException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> BadImageFormatException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parameters

info
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

The SerializationInfo that holds the serialized object data about the exception being thrown.

context
StreamingContext StreamingContext StreamingContext StreamingContext

The StreamingContext that contains contextual information about the source or destination.

Remarks

This constructor is called during deserialization to reconstitute the exception object transmitted over a stream.

BadImageFormatException(String, Exception) BadImageFormatException(String, Exception) BadImageFormatException(String, Exception) BadImageFormatException(String, Exception)

Initializes a new instance of the BadImageFormatException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public:
 BadImageFormatException(System::String ^ message, Exception ^ inner);
public BadImageFormatException (string message, Exception inner);
new BadImageFormatException : string * Exception -> BadImageFormatException
Public Sub New (message As String, inner As Exception)

Parameters

message
String String String String

The error message that explains the reason for the exception.

inner
Exception Exception Exception Exception

The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.

Remarks

An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. The InnerException property returns the same value that is passed into the constructor, or null if the InnerException property does not supply the inner exception value to the constructor.

The following table shows the initial property values for an instance of BadImageFormatException.

Property Value
InnerException The inner exception reference.
Message The error message string.
See also

BadImageFormatException(String, String) BadImageFormatException(String, String) BadImageFormatException(String, String) BadImageFormatException(String, String)

Initializes a new instance of the BadImageFormatException class with a specified error message and file name.

public:
 BadImageFormatException(System::String ^ message, System::String ^ fileName);
public BadImageFormatException (string message, string fileName);
new BadImageFormatException : string * string -> BadImageFormatException
Public Sub New (message As String, fileName As String)

Parameters

message
String String String String

A message that describes the error.

fileName
String String String String

The full name of the file with the invalid image.

Remarks

The content of the message parameter 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.

Property Value
FileName The full name of the file with the invalid image.
Message The error message string.

BadImageFormatException(String, String, Exception) BadImageFormatException(String, String, Exception) BadImageFormatException(String, String, Exception) BadImageFormatException(String, String, Exception)

Initializes a new instance of the BadImageFormatException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public:
 BadImageFormatException(System::String ^ message, System::String ^ fileName, Exception ^ inner);
public BadImageFormatException (string message, string fileName, Exception inner);
new BadImageFormatException : string * string * Exception -> BadImageFormatException
Public Sub New (message As String, fileName As String, inner As Exception)

Parameters

message
String String String String

The error message that explains the reason for the exception.

fileName
String String String String

The full name of the file with the invalid image.

inner
Exception Exception Exception Exception

The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception.

Remarks

An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. The InnerException property returns the same value that is passed into the constructor, or null if the InnerException property does not supply the inner exception value to the constructor.

The following table shows the initial property values for an instance of BadImageFormatException.

Property Value
InnerException The inner exception reference.
FileName The full name of the file with the invalid image.
Message The error message string.

Applies to