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!

55 responses 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 avatar
    abbas

    thank you , you saved me

  2. Ronald avatar
    Ronald

    thanks.. you’re legend!

  3. Ronald avatar
    Ronald

    thanks you’re legend!

  4. Paula avatar
    Paula

    You safe my life. Thanks a lot.

  5. Amith George avatar
    Amith George

    muchas gracias!!

  6. Marc avatar
    Marc

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

  7. j avatar
    j

    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. Rakesh Thakor avatar

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

    Rakesh Thakor.

  9. Faile avatar
    Faile

    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 avatar
    Moss_collector

    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 avatar
    Sachin

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

  12. Resul Çavuşoğlu avatar
    Resul Çavuşoğlu

    Thank you for really important information.

  13. Josh hern avatar
    Josh hern

    no mames!, eres mi idolo

  14. Lars avatar
    Lars

    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 avatar
    Leyla

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

  16. James Becwar avatar

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

  17. Toren Valone avatar
    Toren Valone

    What about win32 programs using chilkat having the problem?

  18. Srini avatar
    Srini

    Thanks a million

  19. Baris avatar
    Baris

    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 avatar
    Roberto

    Solved my problem.

    Thanks in advance !

  21. […] guy did a nice picture: change app pool to 32 bit This entry was posted in Other. Bookmark the permalink. ← There is a duplicate […]

  22. sd avatar
    sd

    Many Thanks!

  23. Stewart avatar

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

  24. Joey avatar
    Joey

    it’s help for me.
    Thanks

  25. can avatar
    can

    Thanks nhieu nhe ban. I’m Vietnamese

  26. Ryan Sammut avatar

    This was not enough for me to use Oracle.DataAccess . Anyone has any ideas?

  27. Carlos De Jesus avatar
    Carlos De Jesus

    Great post! It help me a lot thanks!!!

    1. hunter avatar
      hunter

      This works for me.
      Upgraded from win 2003 to win 2008 R2 64-bit. Got my XML Bulk loader 4.0 64 bit installed, but still received could not load assembly interop.sqlxmlbulkload until I changed the app pool to allow 32 bit applicaitons.

  28. NIhar avatar

    ‘Oracle.DataAccess, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342’

    This error i got …

    my oracleClient 11g install on x86 ..

    But still get this problem ..?
    Any ideas frnd ?

    1. Alex avatar

      No idea…
      Stackoverflow might be best bet for that question..?

  29. Scooby avatar
    Scooby

    Great tip, BIG THANKS for sharing and saving me a ton of time!!!

  30. Gurarpan Gill avatar
    Gurarpan Gill

    Thanks very much Appreciate your help

  31. Rasmus avatar
    Rasmus

    Thank you. Would never have figured this out myself.

  32. Daniel Comp avatar

    New one on me… thank you.

  33. Jim avatar
    Jim

    Great tip!

    Saved me hours of time sorting out the same exact problem.

    Thanks!

    1. Alex Brown avatar

      No problem, thanks for your comment! 🙂

  34. Pawan avatar
    Pawan

    Thanks that solved me same problem as well..

  35. 香草 avatar
    香草

    太好了,正好解决了我的问题

  36. Zouhir avatar
    Zouhir

    That solved my problem, but now I had an other problem “The requested page cannot be accessed because the related configuration data for the page is invalid.”

  37. CJ avatar
    CJ

    solved my prob.thanx

  38. B. Clay Shannon avatar
    B. Clay Shannon

    Surrey if this is slightly off-topic, but I’m getting that same basic error on a non-asp.net (it doesn’t specify the name of the problem file, though); nevertheless, I’m wondering if changing “Enable32bit” to true has any potential downside (I *am* working on an asp.net app, too … will toggling false to true possibly cause a problem “down the road”?

  39. Arif avatar
    Arif

    thankyou so much…

  40. Parixitsinh Chauhan avatar
    Parixitsinh Chauhan

    thanks a lot .. you solved the problem

  41. jackson bi avatar
    jackson bi

    Thank you, it resolved following problem as well.

    Error message:
    Could not load file or assembly ‘Oracle.DataAccess’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

  42. Nisar avatar
    Nisar

    Thank you so much

  43. Tran Ba Hieu avatar

    You save me!, thanks a lot!

  44. tobi billups avatar
    tobi billups

    Invaluable suggestions – my business several days ago used http://goo.gl/HShLoc. to access pdf – It’s phenominal efficient to apply and it’s excellent ! I saw they will give a 30 day promotion now

  45. Darek Kacban avatar
    Darek Kacban

    It works! Thaks a lot!

  46. Sheik mohammed hussain S avatar
    Sheik mohammed hussain S

    that works for me also… Thanks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *