My understanding is that a .NET application is platform independent, so pure .NET code should run either on a x86 or on a 64-bit machine. Unless your .NET code call some native code, then it is platform dependent. Is that true?
As its name suggests, the 32 bit OS can store and handle lesser data than the 64 bit OS. More specifically, it addresses a maximum of 4,294,967,296 bytes (4 GB) of RAM. The 64 bit OS, on the other hand, can handle more data than the 32 bit OS.
Run the application and launch the Task Manager to know if the process runs in 32-bit mode or 64-bit mode on a 64-bit machine. When "*32" is added to the 'image name', the process is running in 32-bit mode. Otherwise it is running in 64-bit mode.
The 64-bit versions of Windows don't provide support for 16-bit binaries or 32-bit drivers. Programs that depend on 16-bit binaries or 32-bit drivers can't run on the 64-bit versions of Windows unless the program manufacturer provides an update for the program.
.NET applications can be compiled as targeting x86, x64, or "Both". Typically, you'd target just one platform if you rely on a COM control that is not available for the other platform, etc.
Your code can be compiled to be fully platform independent, or you can target a specific platform. The standard recommendation is to leave libraries architecture-neutral (that is, "Any CPU") and target x86 for executables. The reasons why Visual Studio 2010 uses this approach by default are explained here: AnyCPU executables are usually more trouble than they're worth:
- Running in two very different modes (x64 and x86) increases product complexity and the cost of testing.
- 32-bit tends to be (a little) faster anyway.
- Some features aren't available in x64.
- If more than 4 GB address space would be useful, the right thing to do is to target just x64 and avoid the cost of supporting two platforms.
Of course, if you just target x86 then your code would still run on x64 through WoW64.
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