You should use the target
instruction-set architecture named "Any CPU", found in Visual Studio project properties, first tab "Application". If you are not using Visual Studio, see the structure of the project. If you are not using MSBuild projects, see the compiler command-line documentation.
Some background: .NET is based on JIT compilation:
http://en.wikipedia.org/wiki/JIT_compiler[
^].
So, the actual instruction-set architecture doesn't have to be prescribed in the executable file or its assembly manifest. During runtime, .NET will determine what CPU is used from OS and will take it into account while compiling your IL code to native instructions. For 64-bit architectures (it's not one but at least two, incompatible to each other), and application targeted as "AnyCPU" will always be executed in 64-bit mode. However, if your assemblies (or at least the entry-level assembly, others being set to "AnyCPU" or the same architecture and the entry-level) are targeted to x86, it will be executed as 32-bit, which is compatible with all other x86* or IE* architectures and is executed on the WoW64 subsystem:
http://en.wikipedia.org/wiki/WoW64[
^].
"AnyCPU" is compatible with any of the "concrete" architectures, but you never can mix up two assemblies targeted to different "concrete" architectures in the same application/process. It can even compile, but can crash during runtime.
The verdict on this: use "AnyCPU" as much as possible. Other target architectures are really needed for compatibility with some modules targeted for any "concrete" architecture, usually native (unmanaged) modules.
—SA