Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the checkbox 'Prefer 32-bit' disabled in Visual Studio 2012?

I came across a situation in which I would like to set the Prefer 32-bit to true. But in Visual Studio 2012, it is showing as disabled. And no matter what I do it doesn't get enabled.

I read that Any CPU with Prefer 32-bit is the default value for all new projects. So, should I assume that although it is disabled it is set to true? Then how can you set it to be just Any CPU?

In What AnyCPU Really Means As Of .NET 4.5 and Visual Studio 11 and in many other posts and questions here in Stack Overflow it says:

overall, there are now five options for the /platform C# compiler switch: x86, Itanium, x64, anycpu, and anycpu 32bit preferred

What's more, I have some collegues that have mentioned to me that in the past that checkbox was enabled (maybe they are wrong?).

Why is the Prefer 32-bit checkbox disabled, and how can I enable it again?

My processor is 64-bit, and I have applied the Update2 to Visual Studio 2012.

like image 885
Dzyann Avatar asked May 14 '13 15:05

Dzyann


People also ask

What is Visual Studio prefer 32 bit?

When using the "Prefer 32-Bit" flavor of AnyCPU, the semantics are as follows: 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.

Is Visual Studio 32 bit or 64-bit?

Visual Studio 2022 on Windows is now a 64-bit application.


1 Answers

Assuming you've got an executable project, then if you change your target platform to .NET 4.5, it should become enabled.

It's a .NET 4.5-only thing, and it's only enabled for executables.

like image 74
Matthew Watson Avatar answered Sep 21 '22 00:09

Matthew Watson