Friday, December 7, 2012

Investigations:Could not load file or assembly or one of its dependencies.An attempt was made to load a program with an incorrect format.

ERROR: Could not load file or assembly or one of its dependencies.An attempt was made to load a program with an incorrect format. 

Developers generally face this issue in production server, or running a web application under IIS.
The site works fine in the integrated development environment, but fails and giving this error while running it in IIS.
The most likely reason of this issue is the incompatibility of target platforms. 
Say, your  application is targettng to only x32, but the dependent assembly targets to "Any CPU", or vice versa.

In order to fix this issue, you need to change settings of relevant Application Pool in IIS, to allow 32-bit applications.



This should resolve the issue.

No comments:

Post a Comment

Thanks for visiting my blog.
However, if this helped you in any way, please take a moment to write a comment.

Thanks
Nirman