Tuesday, October 30, 2012

IIS : Could not load file or assembly


So I had a website – .NET Framework 4 / IIS 7.5 - working perfectly on my PC.

Moved it to another box and got the error with one of my dlls.

“Could not load file or assembly ‘xxx’ or one of its dependencies. An attempt was made to load a program with an incorrect format”


Mr. Google to the rescue. Normal battle with the ten tons of shite but then one link rang a bell.

My original box was 32 bit whereas the new one is 64 bit.

What you have to do with the ApplicationPool is:

In IIS 7 Manager:

  • Click ApplicationPools
  • Select the one for your application.
  • Click “Advanced Settings” on the right
  • Under “General” at the top, set “Enable 32-bit Applications” to be “True”

Bingo – problem solved.


No comments: