I'm currently having more issues with packaging using the Windows Application Packaging Project (WAPP).
I desire to package my WPF app into an app bundle compatible with 32 and 64 bit systems. In my own app I added the WAPP and referenced it in accordance with this Microsoft Docs article along with doing the initial setup in the projects properties and making x64 and x86 configurations using the Configuration Manager for my WPF project.
Debugging the WAPP runs normally with no issues. When I move to publishing, I set it for sideloading, select the signature and choose to bundle the Release x64 and x86 configurations. During the publish process, the x86 build runs first with no issues, but when doing the x64 part I'm met with this error:
There was a mismatch between the processor architecture of the project being built "AMD64" and the processor architecture of the reference "C:\Users\UserFolder\Documents\InstallerDemoSourceCode\WPFDemoApp\bin\x86\Debug\netcoreapp3.1\win-x86\WPFDemoApp.dll", "x86". This mismatch may cause runtime failures.
I've spent a while making new Wpf projects and downloading examples of other WPF projects using MSIX and attempted publishing which all ends with the same error which seems to indicate an issue with VS or my PC.
I even tried using the project unchanged from this helpful video, where he was able to build it exactly the way I want to, but am unable to do the same due the this error.
However, I did notice in the x64 build output that the build is using my x86 objects instead of x64. You can even see in the error that the DLL it is referencing is in the x86 folder. Is this a bug potentially?
Any leads would be invaluable
UPDATE #1: In response to the suggestion from @JonasH I tried to publish the app in AnyCPU mode and received an alternate error instead:
There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Users\jacob\OneDrive\Documents\InstallerDemoSourceCode\WPFDemoApp\bin\x86\Debug\netcoreapp3.1\win-x86\WPFDemoApp.dll", "x86". This mismatch may cause runtime failures.
So I was able to fix this by literally re-selecting configurations in the Configuration Manager. i.e. Select the Any CPU Profile reselect all the projects build profiles as Any CPU, rinse and repeat for x64 and x86. This somehow worked?
I'm still unable to publish as Any CPU but all information surrounding publishing Desktop apps (WinForms, WPF, etc) to Any CPU suggests that you need to use x86 and x64 explicitly instead as that option only seems to work for UWP.