-3

While trying add *.dll "AWSREMOTELIB" from my project, I encountered this problem...

screenshot of BadImageFormatException

What does this BadFormatException mean?

Frank Boyne
  • 4,400
  • 23
  • 30
  • 3
    Possible duplicate of [Could not load file or assembly 'xxx' or one of its dependencies. An attempt was made to load a program with an incorrect format](http://stackoverflow.com/questions/1648213/could-not-load-file-or-assembly-xxx-or-one-of-its-dependencies-an-attempt-was) – devRicher Jan 11 '17 at 09:09
  • Go to options -> web projects and check "use the 64 bit version..." – ziaprog Apr 28 '20 at 07:53

3 Answers3

12

Right click on your project and go to Properties. Then in the Build section change the Platform target to x64.

Mahdi
  • 3,199
  • 2
  • 25
  • 35
9

A DLL or executable is loaded as a 64-bit assembly, but it contains 32-bit features or resources. For example, it relies on COM interop or calls methods in a 32-bit dynamic link library. To address this exception, set the project's Platform target property to x86 (instead of x64 or AnyCPU) and recompile.

Check this link, it may be a platform problem : https://msdn.microsoft.com/en-us/library/system.badimageformatexception(v=vs.110).aspx

Hope this was useful.

Ali Ezzat Odeh
  • 2,093
  • 1
  • 17
  • 17
0

There are a lot of helpful advice in Could not load file or assembly ... An attempt was made to load a program with an incorrect format (System.BadImageFormatException) If the problem is IIS project - C# Any CPU and part of the project is 32 bit c++ project then all of those in the link won't work- because 32 bit c++ cannot be changed- the solution is bitness see the screenshotenter image description here - in "Apply server settings to all users(store in project file)

JPM
  • 69
  • 5