Could not load file or assembly ‘Name’ or one of its dependencies. An attempt was made to load a program with an incorrect format.
On a 64-bit Windows installation this is caused by the fact that assemblies are compiled for x86 processors only. To change the compile settings do the following:
- Open the project properties
- Open the Compile tab
- Open the Advanced Compile Options… window
- Change the Target CPU from x86 to AnyCPU
- Recompile
Happy programming!
I am a .NET programmer first and foremost. But in my spare time I like to play around with PHP, Erlang, Haskell, F#,
Jeff Geer
13 May, 2009
Instant fix. Thank you!
XxOriuSxX
3 Jun, 2010
Thanks a lot, fixed my problem :)
Dan
7 Jun, 2010
This doesn’t fix the problem however. It will compile and it will run… however……..In Any Cpu (x64) or (x64) configuration you can’t debug properly. You lose JIT edit/continue and other debugging features. I am asking a similar question on the MSFT forums. If inerested in following responses to this question you can go to this link.
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/381f3053-30a4-4ca3-940b-43da72f897f1/
Elmer
7 Jun, 2010
Thanks Dan. I haven’t noticed the lack of edit/continue myself (haven’t tested either). I monitor your post at msdn forums.