Home > Back-end >  How to disable 'prefer 32-bit' on VS2022?
How to disable 'prefer 32-bit' on VS2022?

Time:03-08

Microsoft made the Any CPU option dependent on a property of prefer 32-bit (see here for example). Previously we could disable that on the options of the project.

Now, however, I can't find it in the project's properties.

Where is it hiding?

(To replicate: Create a new WPF project and disable the prefer 32-bit option. How to disable it, you ask? So do I.)

CodePudding user response:

If you want to run your .NET 6 app as a 64-bit processes on a 64-bit operating system and as a 32-bit process on a 32-bit machine, the only thing you need to do is to set the target platform to Any CPU.

When running the app you should then be able to confirm that the Environment.Is64BitProcess property returns true on a 64-bit system.

  • Related