What’s the easiest way to discover (without access to the source project) whether a .NET assembly DLL was compiled as ‘x86’, ‘x64’ or ‘Any CPU’?
Update: A command-line utility was sufficient to meet my immediate needs, but just for the sake of completeness, if someone wants to tell me how to do it programmatically then that would be of interest too, I’m sure.
If you just want to find this out on a given dll, then you can use the CorFlags tool that is part of the Windows SDK:
If you want to do it using code, take a look at the GetPEKind method of the Module class:
You then need to examine the
peKindto check its value. See the MSDN docs forPortableExecutableKindsfor more info.