1

A similar Question has been asked before (like 5 years ago). Today I looked for this question, because it seems there has something changed with that.

You see, as legid marked answers to the question "What does Any CPU target mean?" where "It behaves as an x64 on 64-bit systems and as x86 on 32-Bit systems.".

I just tried that out and it tells me in my task manager that its actually running as a 32-Bit Application. Was it always like that or has something changed over the years? Or did I get something wrong? Is the Task-Manager lying mabye?

Here is a screenshot which shows a running Any-CPU Application on a 64-bit system:

Here is a screenshot which shows a running Any-CPU Application on a 64-bit system.

How can I actually make sure that my Application is ran as 64-Bit Process on a 64-Bit architecture? Or do we need to go back to shipping always two versions of our applications?

magicandre1981
  • 27,895
  • 5
  • 86
  • 127
Ravior
  • 561
  • 2
  • 9
  • 30
  • You can find what it means [here](https://msdn.microsoft.com/en-us/library/zekwfyz4.aspx) – Nasreddine May 26 '16 at 08:08
  • 5
    It is the Solution Platform name. Pretty meaningless for managed projects, it only really matters for C++ projects. But otherwise pretty descriptive, managed code can run on any cpu. The setting you *really* care about is the one that forces a particular jitter to be used at runtime. Right-click your EXE project > Properties > Build tab. Sadly the default is still to have the "Prefer 32-bit" checkbox ticked, hopefully the next version of VS puts an end to that. – Hans Passant May 26 '16 at 09:43
  • 3
    There is, sadly, a good reason for "Prefer 32-bit" - .NET uses pointers to heap memory for almost everything, such that each object contains pointers to all of the objects beneath it. When you double the size of a pointer, that often nearly doubles the memory requirements for the application, effectively cutting your CPU's cache performance in half. Unless the application really needs more than 2GB of memory, you're better off using 32-bit in most (not all) cases. Now, if .NET could optimize a little better, and make better use of r7 - r15, it might balance out the lost cache performance. – Matt Jordan May 26 '16 at 15:19

0 Answers0