How do I tell if my application (compiled in Visual Studio 2008 as Any CPU) is running as a 32-bit or 64-bit application?
I found this code from Martijn Boven that does the trick:
public static bool Is64BitMode() { return System.Runtime.InteropServices.Marshal.SizeOf(typeof(IntPtr)) == 8; }