0

**I've been working around with a dll that was first created in a x32 version of C# 2010. Now, I installed Windows 7 x64 and C# on my PC.

The project works fine. I can edit all project forms but when I hit the debug button or the Compile button, it returns below error and shows "No source found".

BadImageFormatException

Does anyone know how to fix this problem or if x64 is the problem?

Adarsh Shah
  • 6,755
  • 2
  • 25
  • 39
RockSolid
  • 202
  • 1
  • 3
  • 20
  • 1
    possible duplicate of [Use a 32-bit assembly in 64-bit environment](http://stackoverflow.com/questions/6744284/use-a-32-bit-assembly-in-64-bit-environment) – Adarsh Shah Dec 29 '13 at 16:51

3 Answers3

4

You cannot load a 32-bit DLL in a 64-bit process.

Either change the DLL to AnyCPU, or change the EXE project to x86-only.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
2

You must change your platform to 32bit

enter image description here

If you cannot see the x86, select the New... option

enter image description here

select the x86 here:

enter image description here

Hossein Narimani Rad
  • 31,361
  • 18
  • 86
  • 116
2

Try to get Virtual Box, install in Virtual BOX a x32 Windows, and work in Virtual Box your project. After you done, save it to your machine :)

X32 apps runs on x64

RockSolid
  • 202
  • 1
  • 3
  • 20