Tuesday, 1 March 2011

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

I just had a problem with the error message in IIS that reads:

Could not load file or assembly 'yourassemblyname' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly 'Sicon.API' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Now this message is not particularly helpful but after a while searching the problem was caused becuase the web application was installed on a 64bit server, in a 64bit application pool when the web application is compiled specifically for 32bit.

This is easy enough to fix by changing the application pool to allow 32bit applications from the advanced settings screen.

No comments:

Post a Comment