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)
Then set “Enable 32-bit Applications” to True.
All done!

Yes, thank you. You helped me a lot.
Also see http://stackoverflow.com/questions/41449/i-get-a-an-attempt-was-made-to-load-a-program-with-an-incorrect-format-error-on/2926982#2926982
thank you , you saved me
thanks.. you’re legend!
thanks you’re legend!
You safe my life. Thanks a lot.
muchas gracias!!
You are a hero! Thank you for saving us all.
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?
Many Many Thanks for the article. Its really helpful. Fixed my issue.
Rakesh Thakor.
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
Useless,I agree with J.This is not working in main [IIS] application is 64 BIt and it is trying to access 32Bit dll.
Really help me lot…..i was wasted last 2 days on it…
Thank you for really important information.
no mames!, eres mi idolo
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.
This suggestion didn’t help me, again I take the same error.
Thanks a million, never would have figured it out!
-James
What about win32 programs using chilkat having the problem?
Thanks a million
if you are using in windows forms application
go to project properties–>>Build tab and change platform target to x86,
problem will be solved
Solved my problem.
Thanks in advance !
Many Thanks!
Thanks! This really helped. The developer didn’t even know that Chilkat was used in one of his teams shared DLLs.