I\'ve got an arbitrary list of .NET assemblies.
I need to programmatically check if each DLL was built for x86 (as opposed to x64 or Any CPU). Is this possible?
One more way would be to use dumpbin from the Visual Studio tools on DLL and look for the appropriate output
dumpbin.exe /HEADERS
FILE HEADER VALUE
14C machine (x86)
4 number of sections
5885AC36 time date stamp Mon Jan 23 12:39:42 2017
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
2102 characteristics
Executable
32 bit word machine
DLL
Note: Above o/p is for 32bit dll
One more useful option with dumpbin.exe is /EXPORTS, It will show you the function exposed by the dll
dumpbin.exe /EXPORTS