Identify If a DLL is 32bit or 64bit

Copying Files Via Project Script On Build Banner Image

You do not have to guess if a DLL or assembly is targeting 32bit(x86) or 64bit(x64). Visual Studio comes with a handy tool called Corflags. You can access this tool by the Visual Studio command prompt. f I created test assemblies and compiled them in Visual Studio to demonstrate the usage of this tool. You can skip ahead to a particular example through the links below.

#TargetPE32BITREQ
132BitPE321
264BitPE32+0
3Any CPUPE320
4Any CPU with Prefer 32 bitPE321

In Visual Studio 2019, the command prompt can be found under Tools-> Command Line -> Developer Command Prompt

Developer Command Prompt for Corflags Navigate to the directory of the DLL then type in the command below.

Command:corflags #dll_name#.dll

Examples Below:

32bit Assembly

32bit Assembly Build Parameters
C:\temp>corflags TestLibrary32Bit.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.8.3928.0
Copyright (c) Microsoft Corporation. All rights reserved.
Version : v4.0.30319
CLR Header: 2.5
PE : PE32
CorFlags : 0x3
ILONLY : 1
32BITREQ : 1
32BITPREF : 0
Signed : 0

When PE equals PE32 and 32BITREQ equals 1

64bit Assembly

64bit Assembly Build Parameters
C:\temp>corflags TestLibrary64Bit.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.8.3928.0
Copyright (c) Microsoft Corporation. All rights reserved.
Version : v4.0.30319
CLR Header: 2.5
PE : PE32+
CorFlags : 0x1
ILONLY : 1
32BITREQ : 0
32BITPREF : 0
Signed : 0

When PE equals PE32+ and 32BITREQ equals 0

Any CPU Assembly

Any CPU Assembly Build Parameters
C:\temp>corflags TestLibraryAnyCPU.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.8.3928.0
Copyright (c) Microsoft Corporation. All rights reserved.
Version : v4.0.30319
CLR Header: 2.5
PE : PE32
CorFlags : 0x1
ILONLY : 1
32BITREQ : 0
32BITPREF : 0
Signed : 0

When PE equals PE32 and 32BITREQ equals 0

Any CPU With Prefer 32bit

Any CPU with Prefer 32bit Assembly Build Parameters
C:\temp>corflags AssemblyTargets64BitOr32Bit.exe
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.8.3928.0
Copyright (c) Microsoft Corporation. All rights reserved.
Version : v4.0.30319
CLR Header: 2.5
PE : PE32
CorFlags : 0x20003
ILONLY : 1
32BITREQ : 0
32BITPREF : 1
Signed : 0

When PE equals PE32 and 32BITREQ equals 1.

Get Latest Updates