System.IO.FileLoadException Class

The exception that is thrown when a managed assembly is found but cannot be loaded.

See Also: FileLoadException Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public class FileLoadException : IOException

Remarks

Represents the error that occurs when a System.Reflection.Assembly file is found but cannot be loaded.

The System.IO.FileNotFoundException exception is thrown when the file fails to load because it cannot be located. If the file is located, but cannot be loaded due to insufficient permissions, a System.Security.SecurityException is thrown.

FileLoadException has the default HRESULT of COR_E_FILELOAD, which has the value 0x80131621, but this is not the only possible HRESULT.

If your code does not have System.Security.Permissions.FileIOPermissionAttribute.PathDiscovery permission, the error message for this exception may only contain file or directory names instead of fully qualified paths.

Note:

This exception is not included in the tp://go.microsoft.com/fwlink/?LinkID=247912 or the Portable Class Library, but it is thrown by some members that are. To catch the exception in that case, write a catch statement for System.IO.IOException instead.

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0