What does the "Prefer 32-bit" compiler flag mean for Visual Studio (C#, VB)?

Here's right and simple answer:

Application arch.


EDIT: Application compiled with "Any CPU 32-bit preferred" is compatible with x86, x64 and ARM, while x86 is compatible only with x86, x64 and not ARM. For details see this.


It likely indicates the app is AnyCpu but when 32 bit is available it shouold run as such. This makes sense - 64 bit apps use more memory, and sometimes you just dont need the memory space ;)


There is an good article at What AnyCPU Really Means As Of .NET 4.5 and Visual Studio 11.

The short answer to your question is "When using that flavor of AnyCPU, the semantics are the following:

If the process runs on a 32-bit Windows system, it runs as a 32-bit process. IL is compiled to x86 machine code. If the process runs on a 64-bit Windows system, it runs as a 32-bit process. IL is compiled to x86 machine code. If the process runs on an ARM Windows system, it runs as a 32-bit process. IL is compiled to ARM machine code. The difference, then, between “Any CPU 32-bit preferred” and “x86” is only this: a .NET application compiled to x86 will fail to run on an ARM Windows system, but an “Any CPU 32-bit preferred” application will run successfully."