views:

91

answers:

3

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

Regards, Mita

A: 

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

GvS
I understand when a each configuration should be used.I don't understand what is the difference between 32bit and 64bit .NET assemblies.
Mita
Difference is one bit the 32BIT
GvS
+1  A: 

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.

STO
I understand when a each configuration should be used.I don't understand what is the difference between 32bit and 64bit .NET assemblies.
Mita
A: 

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?
Will Marcouiller