Last Updated: May 15, 2019
·
1.554K
· squioc

Find target architecture of a DLL

Sometimes, you need to find the target architecture of a DLL (because you face exception like System.BadImageFormatException or whatever else). Fortunately, Visual Studio come with a set of tools.

From the start menu, point to Microsoft Visual Studio 20xx > Visual Studio Tools then select Developer Command Prompt. Go to your working directory then execute:

dumpbin /headers <my dll> | find "machine"

it will result:

14C machine (x86)
32 bit word machine

for 32 bit libraries

8664 machine (x64)

for 64 bit libraries

Tip find on stackoverflow