Cloud Training (Online)




Could not load file or assembly. An attempt was made to load a program with an incorrect format (System.BadImageFormatException)

There are times when you might get the below error when you have multiple projects with-in your Visual Studio solution.

BadImageFormatException was unhandled:
Could not load file or assembly ‘AbundantcodeProjectA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. An attempt was made to load a program with an incorrect format. (System.BadImageFormatException)

One of the Main reasons for this error is the conflict on the platform target. You might be having your project set to 32-bit platform while referencing a 64-bit assembly.


You can fix the issue by setting the wirht platform target for all the projects.