My solution: static bool is64BitProcess = (IntPtr.Size = 8) How to detect programmatically whether you are running on 64-bit Windows If this returns true, you are running in a 32-bit process on 64-bit Windows.
NET you can do so by checking IntPtr.Size), and if you are running in a 32-bit process, you still have to call the Win API function IsWow64Process. NET Framework 2.0 on 64-bit Windows (it would return 32-bit).Īs Microsoft's Raymond Chen describes, you have to first check if running in a 64-bit process (I think in. IntPtr.Size won't return the correct value if running in 32-bit. NET Framework 4.0, you can just check Environment.Is64BitOperatingSystem. UPDATE: As Joel Coehoorn and others suggest, starting at.