How do I create an MSIX package for a .Net ore 3.1 WPF app?

Viewed 251

I am attempting to create an MSIX package for a .NET Core 3.1 WPF app.

I 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

Part of the error message includes: 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.

I have tried changing the targeted processor in both the Configuration Manager and the Publish - Create Package wizard but cannot seem to get past the error.

Cant find a similar error when searching and there is no error code.

1 Answers

This issue was more about the Configuration Manager than the MSIX package project. The necessary step is to open the Configuration Manager and change the Platform of your project's configuration to a discrete platform (ie, not Any CPU)

To accomplish this, click the Configuration dropdown of the project you would like to modify and select a configuration (such as Debug). Then, click the Platform dropdown (which says "Any CPU" by default) and select New. From the "New platform" dropdown of this dialog box select a platform such as x64. The "Copy settings from:" dropdown should remain "Any CPU". The "Create new solution platforms" checkbox should be unchecked.

Rebuild the solution.

Next, add an Windows Application Packaging project, add the application reference and rebuild again.

Finally, right click on the MSIX projects and select Publish then Create App Packages. Make selections appropriate for you package. At the last step in wizard, uncheck the "Neutral" architecture and check the architecture that you created and compiled in the steps outlined above.

Click Create.

Related