Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I tell whether I am on x64 or x86 using .NET?

Tags:

.net

x86

64-bit

I'd like to offer my users correct links to an upgraded version of my program based on what platform they're running on, so I need to know whether I'm currently running on an x86 OS or an x64 OS.

The best I've found is using Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE"), but I would think there would be some built-in facility for this?

like image 949
Domenic Avatar asked Sep 18 '08 08:09

Domenic


1 Answers

Environment.Is64BitOperatingSystem and Environment.Is64BitProcess are being introduced in .NET 4. For .NET 2 you'll need to try out some of the other answers.

like image 102
Richard Szalay Avatar answered Oct 10 '22 18:10

Richard Szalay