Is there a way to tell if the executing assembly is running in 32bit or 64bit? I understand how to tell if it’s compilied as ILOnly, x86, etc and if the OS is running 32 or 64. I could still have a dll as AnyCPU on a 64bit OS still running as 32bit because of the host app is running in 32 bit. So, is there a way the dll can tell if it’s running 32 or 64? Thanks!
Share
You can call Environment.Is64BitProcess in .NET 4.
In .NET 3.5 and earlier, the easiest method is to check the size of an IntPtr:
If either of the above is false, the program is running as a 32bit Executable.