Tuesday, August 18, 2009

Code: Enabling 32 bit builds in IIS 7 64 bit

I ran into a new error today:

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

Turns out it was caused by referencing a 3rd party assembly built for 32 bit, on my 64 bit machine.  The fix was easy once I found it.  Just need to open IIS Manager, right click on the application pool that is hosting the web site, and click Advanced Settings.  Then change "Enable 32-Bit Applications" to True.