I think I should get 8 when I use IntPtr.Size. However, I still get 4 on a 64-bit machine with Windows 7 x64. Why?
Check your file CPU architecture. Is it x86? It should be Any CPU or x64.
The 64 bit operating system implements an emulated environment known as WOW64 which emulates the 32 bit Windows environment. You are building your program targeting x86, i.e. 32 bit. That means that your process runs under the emulator as a 32 bit process and of course pointers are 4 bytes wide.
If you change your options to target x64 or AnyCPU then the pointer size will be 8 bytes when your process runs on a 64 bit system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With