FileLoadException FileLoadException FileLoadException FileLoadException Constructors

Definition

Overloads

FileLoadException() FileLoadException() FileLoadException()

Initializes a new instance of the FileLoadException class, setting the Message property of the new instance to a system-supplied message that describes the error, such as "Could not load the specified file." This message takes into account the current system culture.

FileLoadException(String) FileLoadException(String) FileLoadException(String) FileLoadException(String)

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

FileLoadException(SerializationInfo, StreamingContext) FileLoadException(SerializationInfo, StreamingContext) FileLoadException(SerializationInfo, StreamingContext) FileLoadException(SerializationInfo, StreamingContext)

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

FileLoadException(String, Exception) FileLoadException(String, Exception) FileLoadException(String, Exception) FileLoadException(String, Exception)

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

FileLoadException(String, String) FileLoadException(String, String) FileLoadException(String, String) FileLoadException(String, String)

Initializes a new instance of the FileLoadException class with a specified error message and the name of the file that could not be loaded.

FileLoadException(String, String, Exception) FileLoadException(String, String, Exception) FileLoadException(String, String, Exception) FileLoadException(String, String, Exception)

Initializes a new instance of the FileLoadException class with a specified error message, the name of the file that could not be loaded, and a reference to the inner exception that is the cause of this exception.

FileLoadException() FileLoadException() FileLoadException()

Initializes a new instance of the FileLoadException class, setting the Message property of the new instance to a system-supplied message that describes the error, such as "Could not load the specified file." This message takes into account the current system culture.

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

Remarks

The InnerException property and FileName property of the new instance are initialized to null.

See also

FileLoadException(String) FileLoadException(String) FileLoadException(String) FileLoadException(String)

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

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

Parameters

message
String String String String

A String that describes the error. The content of message 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.

Remarks

This constructor initializes the Message property of the new instance using message. The InnerException property and FileName property of the new instance are initialized to null.

See also

FileLoadException(SerializationInfo, StreamingContext) FileLoadException(SerializationInfo, StreamingContext) FileLoadException(SerializationInfo, StreamingContext) FileLoadException(SerializationInfo, StreamingContext)

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

protected:
 FileLoadException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected FileLoadException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.IO.FileLoadException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.IO.FileLoadException
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.

See also

FileLoadException(String, Exception) FileLoadException(String, Exception) FileLoadException(String, Exception) FileLoadException(String, Exception)

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

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

Parameters

message
String String String String

A String that describes the error. The content of message 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.

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

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

For more information on inner exceptions, see InnerException.

See also

FileLoadException(String, String) FileLoadException(String, String) FileLoadException(String, String) FileLoadException(String, String)

Initializes a new instance of the FileLoadException class with a specified error message and the name of the file that could not be loaded.

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

Parameters

message
String String String String

A String that describes the error. The content of message 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.

fileName
String String String String

A String containing the name of the file that was not loaded.

Remarks

This constructor initializes the Message property of the new instance using message and the FileName property using fileName. The InnerException property of the new instance is initialized to null.

FileName is not required to be a file stored on disk; it can be any part of a system that supports access to streams. For example, depending on the system, this class might be able to access a physical device.

See also

FileLoadException(String, String, Exception) FileLoadException(String, String, Exception) FileLoadException(String, String, Exception) FileLoadException(String, String, Exception)

Initializes a new instance of the FileLoadException class with a specified error message, the name of the file that could not be loaded, and a reference to the inner exception that is the cause of this exception.

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

Parameters

message
String String String String

A String that describes the error. The content of message 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.

fileName
String String String String

A String containing the name of the file that was not loaded.

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.

FileName is not required to be a file stored on disk; it can be any part of a system that supports access to streams. For example, depending on the system, this class might be able to access a physical device.

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

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

For more information on inner exceptions, see InnerException.

See also

Applies to