如何查看一个Application是32位的还是64位的?

确定.NET程序位数的方法

使用process explorer查看,找到对应的进程。

注册表的路径是Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\

 

 

使用powershell查看

[reflection.assemblyname]::GetAssemblyName("${pwd}\AssemblyTest.exe") | fl    命令中的pwd是指当前路径

https://stackoverflow.com/questions/270531/how-to-determine-if-a-net-assembly-was-built-for-x86-or-x64

 

 

使用visual studio自带的CorFlags

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional>cd "C:\Users\clu\source\repos\Edenred\Test\AssemblyTest\bin\Debug"

C:\Users\clu\source\repos\Edenred\Test\AssemblyTest\bin\Debug>corflags AssemblyTest.exe
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.6.1055.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

 

https://stackoverflow.com/questions/18608785/how-to-interpret-the-corflags-flags

Microsoft .NET 4.5 introduced a new option, Any CPU 32-bit Preferred. In the new version of CorFlags.exe, the 32BIT flag no longer exists, instead, two new flags were added, 32BITREQ and 32BITPREF.

Somewhere based on the below explanation, we can interpret new CorFlags as follows.

CPU Architecture           PE      32BITREQ   32BITPREF
------------------------   -----   --------   ---------
x86 (32-bit)               PE32           1           0
x64 (64-bit)               PE32+          0           0
Any CPU                    PE32           0           0
Any CPU 32-Bit Preferred   PE32           0           1

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值