Could not load file or assembly ‘<some assembly name>’ or one of its dependencies. An attempt was made to load a program with an incorrect format.
Today I stuck with the following problem: when I run my web project through local dev server or IIS Express — everything is fine, but when I host it through IIS, I get “Could not load file or assembly ‘<some assembly name>’ or one of its dependencies. An attempt was made to load a program with an incorrect format.”
One crucial detail: my server is 64-bit.
The solution is in application pool settings: in advanced settings of AppPool, set Enable 32-bit applications to true.