Visual Studio 2010/2012: 32 or 64 bit?

I am using C #. If I build the solution in Visual Studio 2010 or 2012, I get the default Debug / Release configuration and the Any Processor platform. Am I building a 32 or 64 bit application?

+3


source to share


3 answers


You are creating a .Net executable that will run on 32 bit or 64 bit machines in a 32 bit or 64 bit context. It really matters if you are using unmanaged resources!



For example, if you compile for AnyCPU, but use a 32-bit DLL, your application will crash on 64-bit machines .

+5


source


"Any processor" means exactly what it says: Any CPU.

It will work like the native bitness of the OS.



If you check Prefer 32-bit

it will work like x86 on x86-64 platforms.
(but it can still work like ARM)

+8


source


You should watch out, setting the platform for config does not actually select the platform in the C # project. This confusion stems from the integration of C ++ into Visual Studio, the IDE where this value matters.

The corresponding setting is controlled by the project property. Project + Properties, Build tab, Target Platform Assignment. By default for x86 for VS2010 projects, "Prefer 32-bit" is checked for VS2012 projects. You can select AnyCPU and disable the preferred 32-bit option for your EXE project to get a 64-bit process. It is understood that this setting does not necessarily match the platform setting. This has caused a lot of confusion.

+3


source







All Articles