1

Is there anyway I can find out if my .NET process is running as 32bit process or 64bit process?

3 Answers3

5

You probably want Environment.Is64BitProcess if you're using .NET 4.0 or later. Otherwise, check IntPtr.Size, as suggested in the other answers.

Jim Mischel
  • 131,090
  • 20
  • 188
  • 351
3
if (IntPtr.Size == 4)
    // 32-bit

else if (IntPtr.Size == 8)
    // 64-bit

From this question

However, as pointed by @Jim Mischel, on .NET 4 and above, you should use

Environment.Is64BitProcess

Community
  • 1
  • 1
illegal-immigrant
  • 8,089
  • 9
  • 51
  • 84
1

Use IntPtr.Size property to find out process bitness.

if(IntPtr.Size == 4)
 // 32 bit process
else
 // 64bit process