Thursday, August 9, 2012

ERROR - An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

Hmm... I've been getting this crazy error :


 ERROR - An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

This error was driving me nuts. The .NET code works perfectly in local, but when I deployed it in the server, it is throwing this error. I realized it was because of a setting in the IIS app pool. 

Enable 32-Bit Applications.  set that property to "True" and that would take care of that issue.



For some reason, Microsoft has decided to disable this setting by default. When you load the 32-bit libraries like, GraphViz, or any other third party VC++ MFC library dll's, an error would be raised as most likely all those DLL's would've been compiled for 32 bit runtime. This typically happens when you build your stuff on a 32-bit platform or using a 32-bit external DLL's and deploy it to a x64 platform, like Windows 2008 R2 server. 

No comments: