I’ve noticed in VS 2010 the default platform target for a C# project is x86 (it used to be any CPU), and was wondering why the change.
Does the compiler perform any optimizations based on fixing the platform to x86 vs x64 vs Any CPU?
Should I be forcing my apps to one platform or the other for performance reasons?
The previous version of Visual Studio used to default this to “Any CPU”, which means that on a x86 machine you would always end up using x86, wheras on a x64 machine you would end up either running x64 or x86 depending on whether or not the process that the assembly is being loaded into was 32bit or 64bit.
The trouble is that when starting a new process a .Net exe built with the “Any CPU” option will end up as a 64 bit process rather than as a 32 bit process which can cause problems for 2 reasons:
As so few applications actually use enough address space (i.e. memory) to make the hassle worthwhile, the default was changed to x86 in order to avoid these problems.