Wednesday, March 3, 2010

Code: An attempt was made to load a program with an incorrect format.

I received the following error message today when setting up a website in IIS 7 (on Windows 7):

Could not load file or assembly X or one of its dependencies. An attempt was made to load a program with an incorrect format.

This error was due to a 32 bit website on a 64 bit system.  To fix this you need to go to the Advanced Settings on the Application pool and set “Enable 32-Bit Applications” to True.

image