Today while working with a sample project I was getting Could not load file or assembly 'xxxxxxx' or one of its dependencies. An attempt was made to load a program with an incorrect format. I was getting this error when I deployed the dll of that sample to IIS application. The solution was to allow 32 bit applications to run in that application pool. Since my sample dll was built in x86 platform I had to set my pool to allow 32 bit applications to run. Below are the steps to do the same:Go to your app pool where your application is running.
Go to advance settings.
In General tab set Enable 32-Bit Applications to true.
After doing this I was able to run the dlls built on x86 platform.