The SLAR (vol2) on System.BadImageFormatException


Continuing in the series sharing some of the information in the .NET Framework Standard Library Annotated Reference Vol 1 and .NET Framework Standard Library Annotated Reference Vol 2 with some information on BadImageFormatException.


 


BA


You have to be careful when you pick a code name for a project as they sometimes leak out into


the final product. “Fusion” (as in the FusionLog property) is a classic example of that. Fusion


is the code name for a set of software lifecyle management infrastructure used in the CLR and


some parts of Windows. Now it is immortalized in this property that returns information about


the fusion probing history.


 


BG


Some people have recently asked what this refers to—does it refer to a corrupt JPEG or bitmap,


or a corrupt file of any sort? It was meant to refer to an executable or a DLL. The name comes


from the OS loader’s terminology for a portable executable (PE) image. Perhaps in a future


version we’ll add a different exception for general file format corruption.


 

Comments (1)

  1. joshwil says:

    This becomes an important exception to know about now that we’re moving to a world with both 32-bit and 64-bit systems.

    On a 64-bit system if you try to load a 32-bit DLL into a 64-bit process (say that 5 times fast) you will get a BadImageFormatException. See my blog entry on the topic for more explanation:

    http://blogs.msdn.com/joshwil/archive/2005/04/08/406567.aspx