Reproduce as follows:
On VS2022 (17.4.1) Windows 10 Pro (19045.2251)
- Create WPF project (.Net 6.0)
Change target OS version (in project properties) to 10.0.19041.0(doesn't matter)- Add a packaging project.
- Add the WPF project as an "Application" to the packaging project.
- Select the packaging project in solution explorer.
- Project > Publish > Create app package.
- "Microsoft Store as..." (you'll need to associate it with some app).
- Create the package (it'll automatically target "Neutral - Release (AnyCPU").
- Get the following error:
There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "...\MyApp
MyApp\bin\x86\Release\net6.0-windows10.0.19041.0\win-x86\MyApp.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. WapProjTemplate1 C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 2353
It used to work, and still does when clicking F5 even when setting the packaging project as startup project. But not when building the package for the Store.
How can I create a package for the Store now?
EDIT - More Info
Clicking on: Solution Explorer > (The solution) > Right click > Properties > configuration properties > configuration > and choosing "all configurations" in the top left ("Configuration" drop-down) shows me everything is targeting "AnyCPU", both debug and release. Also, all possible check boxes are checked.