Question

Just got the Visual Studio 11 developer preview installed. I see a new option in the project properties called "Prefer 32-bit" when compiling a managed (C#, VB) application with the AnyCPU target specified. This doesn't appear to be an option for class libraries, just top-level apps.

What does this flag indicate?

Was it helpful?

Solution

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 ;)

OTHER TIPS

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.

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

Here's right and simple answer:

Application arch.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top