How can I determine if a .NET assembly was built for x86 or x64?

后端 未结 15 898
面向向阳花
面向向阳花 2020-11-22 09:08

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?

15条回答
  •  太阳男子
    2020-11-22 09:41

    cfeduke notes the possibility of calling GetPEKind. It's potentially interesting to do this from PowerShell.

    Here, for example, is code for a cmdlet that could be used: https://stackoverflow.com/a/16181743/64257

    Alternatively, at https://stackoverflow.com/a/4719567/64257 it is noted that "there's also the Get-PEHeader cmdlet in the PowerShell Community Extensions that can be used to test for executable images."

提交回复
热议问题