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

Whilst setting up an application to run on my local machine (running Vista 64bit) I encountered this error:

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

 

Obviously, the application uses ChilKat components, but it would seem that the version we are using, is only the 32bit version.

To resolve this error, I set my app pool in IIS to allow 32bit applications.
Open up IIS Manager, right click on the app pool, and select Advanced Settings (See below)

 

Set IIS AppPool Advanced Settings

Then set “Enable 32-bit Applications” to True.

Enable 32-Bit Applications

All done!

26 Replies to Could not load file or assembly ‘ChilkatDotNet2′ or one of its dependencies. An attempt was made to load a program with an incorrect format.

  1. abbas says:

    thank you , you saved me

  2. Ronald says:

    thanks.. you’re legend!

  3. Ronald says:

    thanks you’re legend!

  4. Paula says:

    You safe my life. Thanks a lot.

  5. Amith George says:

    muchas gracias!!

  6. Marc says:

    You are a hero! Thank you for saving us all.

  7. j says:

    Useless. Switching that on will run the workerprocess(w3wp) also in 32-bit mode.

    How to make a 64-bit web app which refers to 32-bit DLLs inside the same app pool?

  8. Many Many Thanks for the article. Its really helpful. Fixed my issue.

    Rakesh Thakor.

  9. Faile says:

    Great I spent hours looking for possible problems in my code and then some more time searching for explainations on the net. Your solution worked 100% on Windows server 2008 64bit and Visual Studio 2010. Thanx

  10. Moss_collector says:

    Useless,I agree with J.This is not working in main [IIS] application is 64 BIt and it is trying to access 32Bit dll.

  11. Sachin says:

    Really help me lot…..i was wasted last 2 days on it…

  12. Resul Çavuşoğlu says:

    Thank you for really important information.

  13. Josh hern says:

    no mames!, eres mi idolo

  14. Lars says:

    Did not help me. There was no change. I restarted IIS also. Still get “an attempt was made .. incorrect format”. I changed both DefaultAppPool, and the app-pol for this specific site.

  15. Leyla says:

    This suggestion didn’t help me, again I take the same error.

  16. James Becwar says:

    Thanks a million, never would have figured it out!
    -James

  17. Toren Valone says:

    What about win32 programs using chilkat having the problem?

  18. Srini says:

    Thanks a million

  19. Baris says:

    if you are using in windows forms application
    go to project properties–>>Build tab and change platform target to x86,
    problem will be solved

  20. Roberto says:

    Solved my problem.

    Thanks in advance !

  21. sd says:

    Many Thanks!

  22. Stewart says:

    Thanks! This really helped. The developer didn’t even know that Chilkat was used in one of his teams shared DLLs.

Trackbacks for this post

  1. I get a “An attempt was made to load a program with an incorrect format” error on a SQL Server replication project - Programmers Goodies
  2. Asp.net / IIS7 : System.BadImageFormatException: Could not load file or assembly | Café Encounter
  3. Could not load file or assembly ‘filename′ or one of its dependencies. An attempt was made to load a program with an incorrect format. « Bus Number 1

Leave a Reply