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 com
Thanks Adrian! I've rewritten the snippet in PowerShell so I could use it on the server.
#USAGE #1
# Get-Bitness (dir *.dll | select -first 1)
#USAGE #2
# Get-Bitness "C:\vs\projects\bestprojectever\bin\debug\mysweetproj.dll"
function Get-Bitness([System.IO.FileInfo]$assemblyFile)
{
$peKinds = new-object Reflection.PortableExecutableKinds
$imageFileMachine = new-object Reflection.ImageFileMachine
$a = [Reflection.Assembly]::LoadFile($assemblyFile.Fullname)
$a.ManifestModule.GetPEKind([ref]$peKinds, [ref]$imageFileMachine)
return $peKinds
}