Archived Forum Post

Index of archived forum posts

Question:

c#, Could not load file or assembly 'ChilkatDotNet45' or one of its dependencies. An attempt was made to load a program with an incorrect format

Feb 18 '13 at 08:19

I'm getting the following error when trying to use the dll. I added the reference to my Web Forms Web Application:

Server Error in '/' Application. Could not load file or assembly 'ChilkatDotNet45' 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 'ChilkatDotNet45' or one of its dependencies. An attempt was made to load a program with an incorrect format.

I don't understand what I'm doing wrong. Tried to deploy to Azure with .NET 4.5. And I'm developing on Windows 8 with .NET 4.5.

EDIT: One more thing I can add is my PC is a 64 bit, so I used the 64 bit library. Once I tried the 32 bit library I worked just fine. Setting on project were Any CPU.


Answer

See http://www.chilkatforum.com/questions/114/64bit-could-not-load-file-or-assembly-chilkatdotnet4-or-one-of-its-dependencies-an-attempt-was-made-to-load-a-program-with-an-incorrect-format