I have assemblies in my mail solution (.net 4.0) from different versions (32 bit) . I have already set “Any CPU” in my VS 2010 project and everything works fine until i deploy it on IIS .
I get “Could not load file or assembly ‘XXXXX’ or one of its dependencies. An attempt was made to load a program with an incorrect format.” error…
–> Go to IIS manager admin window
–> Go to properties of application pool selected for your application
–> Click on default properties of application pool
–> set “Enable-32 bit applications” to True.
Run your application now 🙂