Windows application packaging project shows error when referencing a .Net MAUI project

CFos 41 Reputation points
2022-10-01T15:18:39.617+00:00

Hi,

I am trying to use the Windows Application Packaging Project to build an MSIX for a .Net MAUI application. However, when I right click on the "Dependencies" for the Windows App Packaging project to add a project reference, and then check the box next to the MAUI project and click OK, it shows an error stating "To add an application reference, the project output needs to be an executable.".
In the same solution, I have added a WPF project and it can be referenced without an error. How can I fix the error with the MAUI project so it can be referenced ?
See the screenshot below. The projects are newly added from the templates in VS2022 so they are basic and nothing special about them.

246560-wapp-mauierr.jpg

Thanks for any help!

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,866 questions
0 comments No comments
{count} votes

Accepted answer
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,221 Reputation points Microsoft Vendor
    2022-10-03T09:06:53.31+00:00

    Hello @CFos ,

    Using the Windows Application Packaging Project to build an MSIX is not supported for MAUI application.
    To publish your app, you can open the Developer Command Prompt for VS 2022 terminal and navigate to the folder for your .NET MAUI app project, and run the dotnet publish command.
    For more details, please refer to Publish a .NET MAUI app for Windows - .NET MAUI | Microsoft Learn

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful