Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any considerations needed to be taken running your .net program on x64 vs x86?

Tags:

.net

x86

64-bit

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?

like image 305
Brian R. Bondy Avatar asked Sep 28 '08 02:09

Brian R. Bondy


People also ask

When should I use x64 or x86?

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 x64 and x86 software?

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.

What is x86 and x64 in Visual Studio?

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.

How do I know if I am running x86 or 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.

What is the difference between x86 and x64 version of NET runtime?

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.

Is there a 64-bit version of the NET Framework?

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

What are the memory considerations for x86 and x64?

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).

Does Windows Server 2012 support WoW64 and native 64-bit processing?

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.


3 Answers

Beware of third-party COM libraries or third party .NET libraries that secretly make win32 calls. That's where we had our biggest headaches.

like image 152
Corbin March Avatar answered Oct 25 '22 18:10

Corbin March


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.

like image 40
Mitch Wheat Avatar answered Oct 25 '22 16:10

Mitch Wheat


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.

like image 31
torial Avatar answered Oct 25 '22 17:10

torial