I followed this tutorial from official Microsoft team to use the Windows Application Packaging Project project
in Visual Studio to generate a package for my WPF
desktop app. A Note here reads: If you're packaging a desktop application, right click on the the Windows Application Packaging Project node.
. So I did just that (as shown below). But at the end of the wizard, I got the error shown at the end below:
Remark: My WPF project, MyWPFProject
is a .NET 5
project, and the Application Packaging Project project name is WapProjTemplate1
. I'm using latest version 16.9.3
of VS2019
Question: Why the error, and how can we resolve it. As, the following figure shows, my both projects target the same platform.
Error: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\MyFolder\MyWPFProject\bin\x86\Debug\net5.0-windows\win-x86\MyWPFProject.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 (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets
Any CPU
. – namAny CPU
should work. – emoacht