Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I determine if a .NET application is 32 or 64 bit?

Tags:

.net

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.

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

like image 853
Jonathan Allen Avatar asked Sep 23 '10 20:09

Jonathan Allen


People also ask

How do you tell if .NET application is 32 or 64-bit?

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.

How can I tell if my net assembly is 64-bit?

Probing the Assembly using corflagsLaunch Developer Command Prompt for Visual Studio and then type command corflags <FullPathAndFileNameOfYourAssembly> . The output would consist of few flags which can be interpreted as follows. Assembly will run as x86 (32-bit) only. Assembly will run as x64 (64-bit) only.

Is my Visual Studio 64-bit or 32-bit?

Visual Studio remains a 32 bit application, though certain components (e.g., diagnostics/debuggers, MSBuild, compilers, designers) will take advantage of 64-bit processors if available. We've updated our download pages to clarify this.


1 Answers

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.

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.)

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.

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 

You're looking at PE and 32BIT specifically.

AnyCpu:

PE: PE32 32BIT: 0

x86:

PE: PE32 32BIT: 1

x64:

PE: PE32+ 32BIT: 0

like image 79
Jaco Pretorius Avatar answered Oct 12 '22 07:10

Jaco Pretorius