I believe the architecture type (x86 vs x64) is abstracted away for you when making .Net programs, but are there any other considerations that can cause problems?
The x86 (32-bit processors) has a limited amount of maximum physical memory at 4 GB, while x64 (64-bit processors) can handle 8, 16, and some even 32GB physical memory. A computer with x64 can work with both 32-bit programs and 64-bit programs. However, a computer with x86 can only run 32-bit programs.
What is the difference between x86 and x64? As you guys can already tell, the obvious difference will be the amount of bit of each operating system. x86 refers to a 32-bit CPU and operating system while x64 refers to a 64-bit CPU and operating system.
The Win32 platform name is used for C++ projects, and it means x86. Visual Studio considers both project-level platforms and solution-level platforms, and the project platforms come from the language-specific project systems. C++ projects use Win32 and x64, but the solution platforms use x86 and x64.
Click Start, type system in the search box, and then click System Information in the Programs list. When System Summary is selected in the navigation pane, the operating system is displayed as follows: For a 64-bit version operating system: X64-based PC appears for the System Type under Item.
Aside from these, the x64 version of the .NET runtime seems to, at least in the current versions, perform more optimizations than the x86 equivalent. Things like inlining and memory alignment seem to happen much more often.
On 64-bit operating systems, .NET Framework supports both WOW64 (32-bit processing on a 64-bit machine) and native 64-bit processing. Troubleshoot blocked .NET Framework installations and uninstallations
I understand the memory considerations (x64 addressing all memory, x86 limited to 2/4gb), as well as the fact that an x64 app will use more memory (all pointers are 8 bytes instead of 4 bytes).
On 64-bit operating systems, .NET Framework supports both WOW64 (32-bit processing on a 64-bit machine) and native 64-bit processing. Windows Server 2012 includes .NET Framework 4.5, so you don't have to install it separately.
Beware of third-party COM libraries or third party .NET libraries that secretly make win32 calls. That's where we had our biggest headaches.
From the MSDN doco, among other considerations:
In many cases, assemblies will run the same on the 32-bit or 64-bit CLR. Some reasons for a program to behave differently when run by the 64-bit CLR include:
Structs that contain members that change size depending on the platform, such as any pointer type.
Pointer arithmetic that includes constant sizes.
Incorrect platform invoke or COM declarations that use Int32 for handles instead of IntPtr.
Casting IntPtr to Int32
Also, default file locations.
This article has a lot of good issues to be aware of: http://osnews.com/story/20330/Windows_x64_Watch_List
Personally, my boss has a 64-bit Vista computer, and I program in a 32-bit mode. We've run into the following issues:
Registry for 32 bit apps gets hidden (sort of) into a Wow6432Node folder. Not all apps you are used to finding a path for in the registry will be in that node (SQL Server won't, for instance).
SysWow64 in the C:\Windows folder can cause issues of DLLs not being where they are needed (we had this issue w/ a 3rd party licensing component).
Sometimes the files you need are in "C:\Program Files (x86)", rather than "C:\Program Files". Sucks too.
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