Does it make sense to compile explicitly for x64 with .net?

I am currently building an MSI to install my .net-written (C #) software on an x64-System. This is necessary because I am generating some registry entries, and I don't want to programmatically decide which registry path I should point to (avoiding WOW6432-node).

While doing this, I ask myself if my software needs to be explicitly compiled for x64 systems (Run-Configuration "x64"). Currently I always compile my software in Visual Studio Platform Agnostic with "Any CPU". In my original code, I don't differentiate between x64 and x86.

The CIL code is JIT compiled, so I think it will explicitly compile it to 64-bit at runtime, or am I wrong?

What is the difference between explicit "x64" compilation and platform agnostic compilation in visual studio? How does x64 flag compile?

+3


source to share


1 answer


If your program (with any processor) is running on a 64-bit platform, it will start working in 64-bit mode. This often works very well - the exception is - if you program, you rely on native libraries for which only a 32-bit version is available. Then it will not be able to load that library when it is called (so any problem may not be immediately obvious).



It is also possible to enable 32-bit mode using flags at runtime.

+2


source







All Articles