如何确定.NET应用程序是32位还是64位? [英] How do I determine if a .NET application is 32 or 64 bit?

查看:69
本文介绍了如何确定.NET应用程序是32位还是64位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.NET应用程序,应该将其编译为仅32位应用程序.我怀疑我的构建服务器实际上并没有这样做.

I have a .NET application that was supposed to be compiled as a 32-bit only application. I suspect my build server isn't actually doing it.

如何确定.NET应用程序是否实际设置为以32位模式运行?

How do I determine if a .NET application is actually set to run in 32-bit mode?

推荐答案

如果您要检查正在运行的应用程序是否以32位或64位模式运行,请打开任务管理器,并检查进程名称旁边是否有星号(* 32).

If you're trying to check whether or not a running application is running in 32-bit or 64-bit mode, open task manager and check whether or not it has an asterisk (*32) next to the name of the process.

编辑(从manna的回答中导入):从Win8.1开始,"bitty"表示"bitty".进程的详细信息列在标记为 Platform 的单独的详细信息列中.(右键单击任何列标题,以显示选择列菜单.)

EDIT (imported from answer by manna): As of Win8.1, the "bittyness" of a process is listed in a separate detail column labelled Platform. (Right click on any column header to expose the select columns menu.)

如果您具有编译的dll ,并且要检查它是针对32位还是64位模式进行编译的,请执行以下操作(通过

If you have a compiled dll and you want to check if it's compiled for 32-bit or 64-bit mode, do the following (from a related question). I would think that you want you dll to be compiled for AnyCPU.

打开Visual Studio命令提示符,然后键入"corflags [您的程序集]".您会得到像这样的东西:

Open Visual Studio Command Prompt and type "corflags [your assembly]". You'll get something like this:


c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>corflags "C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll"
    
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 3.5.21022.8 Copyright (c) Microsoft Corporation. All rights reserved.
    
Version : v2.0.50727
CLR Header: 2.5
PE : PE32
CorFlags : 24
ILONLY : 0
32BIT : 0
Signed : 1

您正在专门查看 PE和32BIT .

AnyCpu:

PE:PE3232位:0

PE: PE32 32BIT: 0

x86:

PE:PE3232位:1

PE: PE32 32BIT: 1

x64:

PE:PE32 +32位:0

PE: PE32+ 32BIT: 0

这篇关于如何确定.NET应用程序是32位还是64位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆