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

July 30, 2009

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!


TAGS: - -


# Back

  • Benjamin Boyle
  • abbas

    thank you , you saved me

  • Ronald

    thanks.. you’re legend!

  • Ronald

    thanks you’re legend!

  • Paula

    You safe my life. Thanks a lot.

  • Amith George

    muchas gracias!!

  • Marc

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

  • 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?

  • http://www.thakorsamaj.com Rakesh Thakor

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

    Rakesh Thakor.

  • 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

  • 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.

  • Sachin

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

  • Resul Çavuşoğlu

    Thank you for really important information.

  • Josh hern

    no mames!, eres mi idolo

  • 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.

  • Leyla

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

  • http://www.jamesbecwar.com James Becwar

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

  • Pingback: I get a “An attempt was made to load a program with an incorrect format” error on a SQL Server replication project - Programmers Goodies()

  • Toren Valone

    What about win32 programs using chilkat having the problem?

  • Srini

    Thanks a million

  • 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

  • Roberto

    Solved my problem.

    Thanks in advance !

  • Pingback: Asp.net / IIS7 : System.BadImageFormatException: Could not load file or assembly | Café Encounter()

  • sd

    Many Thanks!

  • http://9rains.com Stewart

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

  • Pingback: 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()

  • Joey

    it’s help for me.
    Thanks

  • can

    Thanks nhieu nhe ban. I’m Vietnamese

  • http://www.ryansammut.com Ryan Sammut

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

  • Carlos De Jesus

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

    • 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.

  • http://niharstechnicalfunda.blogspot.in/ NIhar

    ‘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 ?

    • http://www.alexjamesbrown.com Alex

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

  • Scooby

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

  • Gurarpan Gill

    Thanks very much Appreciate your help

  • Rasmus

    Thank you. Would never have figured this out myself.

  • http://www.intelligentnetware.com Daniel Comp

    New one on me… thank you.

  • Jim

    Great tip!

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

    Thanks!

    • http://www.alexjamesbrown.com/ Alex Brown

      No problem, thanks for your comment! :)

  • Pawan

    Thanks that solved me same problem as well..

  • 香草

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

  • 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.”

  • CJ

    solved my prob.thanx

  • 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”?

  • Arif

    thankyou so much…