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.

Leave A Reply

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

You May Also Like

C# Compiler Error CS0442 – ‘Property’: abstract properties cannot have private accessors Reason for the Error You’ll get this error...
This is a really simple one . Below is a simple example of an enum called “Designation” defined with the...
This blog post explain the usage of the Checked Block in .NET and how you can use them in Visual...