How to publish a WinUI3 project as an exe file?

I have created a WinUI 3 project and finished coding. I want to publish my app as an exe file(It is not necessary to have only one file, there can be many library files). I have searched on the Internet and I found one way. I tried to make the project unpackaged and I added


to csproj file.

It stands to reason that it should be useful. But in fact, it reported an error——"You must deploy before you can debug"(Probably written like this), But I’ve opened the deployment.

How can I resolve this error, or is there another way to solve my problem?

Any suggestions are greatly appreciated.

>Solution :

Your app should run by clicking the *.exe file. But to debug your app, you need to launch it as an Unpackaged app. Check image in the docs.

Leave a Reply