I set my target to "Any CPU" with "Prefer 32-bit" disabled.
I wondered why my process is still running as 32-bit on a 64-bit system, so I checked CorFlags. It confirms, that my executable gets compiled with 32BITPREF enabled.
What would cause this?
I set my target to "Any CPU" with "Prefer 32-bit" disabled.
I wondered why my process is still running as 32-bit on a 64-bit system, so I checked CorFlags. It confirms, that my executable gets compiled with 32BITPREF enabled.
What would cause this?


I checked the project file to see what
<Prefer32Bit>was actually set to, but oddly it wasn't explicitly specified at all.So VS obviously defaults to
<Prefer32Bit>totrueif the tag isn't present, which is consistent with respect to What AnyCPU Really Means As Of .NET 4.5 and Visual Studio 11:Adding
<Prefer32Bit>false</Prefer32Bit>manually solved the issue.No idea why the tag was missing in the first place. Maybe the project was updated from a pre .Net Framework 4.5 version and VS missed to add when performing the project update?
But not setting the "Prefer 32-bit" checkbox when the tag is missing seems to be an oversight from VS.