开发者

Difference between x86 and 64bit assembly in .NET

开发者 https://www.devze.com 2023-01-03 10:32 出处:网络
Could some tell me the difference between 32bit and 64bit .NET assemblies? I understand when it is needed to be precise instead of selecting AnyCPU con开发者_如何学JAVAfiguration.

Could some tell me the difference between 32bit and 64bit .NET assemblies?

I understand when it is needed to be precise instead of selecting AnyCPU con开发者_如何学JAVAfiguration.

Regards, Mita


There are few assembly targets in .NET * x86 - 32bit, the application will run as 32bit process, either on Win64 * x64 - 64bit, the application will run as 64bit process on Win64, and fails to run on 32bit system. * AnyCPU - the application will use the most appropriate targeting. * IA64 - Intel Itanium platform

Generally, in pure managed applications the most appropriate target is AnyCPU. If your application uses PInvoke or COM components, you are possible needed to target your application according to target of unmanaged component you use.


These should provide you with the information inquired:

  1. x64 Development with .NET.
  2. How to determine if a .NET assembly was built for x86 or x64?


I've had some issues running x64 bit code, when interacting with other applications (via COM).

There is some bit in the header of the DLL/EXE that is set to x86 or x64 code, that the .Net loader looks at. The IL is not changed. You can even set it after compilation using CorFlags

0

精彩评论

暂无评论...
验证码 换一张
取 消