I have a .NET solution with several .NET Framework projects inside, two of which generate executables (one is a Windows Service, the other is a WPF app).
Both of those projects target the "Any CPU" platform and do NOT have the "prefer 32bit" flag switched on in the build options.
However, I noticed through the task manager that while the WPF app starts by default in 64bit mode, the service starts in 32bit mode instead.
My question is: why the difference? What determines if a .NET executable that doesn't target a specific platform starts in 32 or 64 bit mode? Is it because it is a Windows Service specifically?
EDIT: re-opening, because the linked supposed "duplicate" question doesn't actually explain why a service would start in 32bit mode on a 64bit machine.