Breyta

Deila með


BadImageFormatException Constructors

Definition

Initializes a new instance of the BadImageFormatException class.

Overloads

BadImageFormatException()

Initializes a new instance of the BadImageFormatException class.

BadImageFormatException(String)

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

BadImageFormatException(SerializationInfo, StreamingContext)
Obsolete.

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

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)

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

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()

Source:
BadImageFormatException.cs
Source:
BadImageFormatException.cs
Source:
BadImageFormatException.cs

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.

Applies to

BadImageFormatException(String)

Source:
BadImageFormatException.cs
Source:
BadImageFormatException.cs
Source:
BadImageFormatException.cs

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

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

Parameters

message
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.

Applies to

BadImageFormatException(SerializationInfo, StreamingContext)

Source:
BadImageFormatException.cs
Source:
BadImageFormatException.cs
Source:
BadImageFormatException.cs

Caution

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

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);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected BadImageFormatException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new BadImageFormatException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> BadImageFormatException
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new BadImageFormatException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> BadImageFormatException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parameters

info
SerializationInfo

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

context
StreamingContext

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

Attributes

Remarks

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

Applies to

BadImageFormatException(String, Exception)

Source:
BadImageFormatException.cs
Source:
BadImageFormatException.cs
Source:
BadImageFormatException.cs

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);
public BadImageFormatException (string? message, Exception? inner);
new BadImageFormatException : string * Exception -> BadImageFormatException
Public Sub New (message As String, inner As Exception)

Parameters

message
String

The error message that explains the reason for the exception.

inner
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

Applies to

BadImageFormatException(String, String)

Source:
BadImageFormatException.cs
Source:
BadImageFormatException.cs
Source:
BadImageFormatException.cs

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);
public BadImageFormatException (string? message, string? fileName);
new BadImageFormatException : string * string -> BadImageFormatException
Public Sub New (message As String, fileName As String)

Parameters

message
String

A message that describes the error.

fileName
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.

Applies to

BadImageFormatException(String, String, Exception)

Source:
BadImageFormatException.cs
Source:
BadImageFormatException.cs
Source:
BadImageFormatException.cs

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);
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

The error message that explains the reason for the exception.

fileName
String

The full name of the file with the invalid image.

inner
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