microsoft-ui-xaml: Published App from Default WinUI 3 Template Is Unresponsive

Describe the bug

I have encountered an issue with publishing Win UI 3 apps. In order to rule out any issues with my code, I am just trying to publish the app generated from the default template, which only contains a “Click Me” button. The specifics of the issue are as follows:

  1. If I deploy the app, the exe file does not respond. The blue progress wheel momentarily appears, but nothing else happens.
  2. If I publish the app, the Setup,exe completes successfully, but when I try to run the installed app, again it is unresponsive.
  3. If I add this line of code: <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> to the project file, the deployed version runs correctly.
  4. However, if I try to publish the version of the app containing this line of code, the Setup,exe gives an error message and will not complete.

In the “Steps to reproduce the bug” section below I describe the simplest method to reproduce each of these behaviours. I have also ensured I have installed the latest stable SDK and RunTime, which are version 1.2. If anyone can advise me how to fix this issue then I would greatly appreciate it.

Steps to reproduce the bug

Setup

  1. Open Visual Studio 2022
  2. Click “Create a new project”
  3. Select "Blank App Packaged (WinUI 3 in Desktop)
  4. Click Next
  5. Click Create
  6. Click Run, and observe that the project runs successfully

Steps to Reproduce Deployment Bug 7. Right click on the project name, and click Deploy 8. Navigate to the deployment output folder (right click on project name and click properties, click on Debug, Open Debug Launch Profiles UI, copy the Layout Folder Path, and paste into Explorer) 9. Double Click the YourAppName.exe file. 10. Nothing happens: That is, the application does not open, but there is no error message displayed. The blue progress wheel is momentarily displayed.

Steps to Reproduce First Publishing Bug 11. Right click on the project name, and click Publish 12. Modify the publishing settings so they are compatible with your operating system 13. Click Publish 14. After the process completes, click the link to navigate to the output folder 15. Double click the Setup File, the setup process completes without issue. 16. Run the installed application, by clicking on the Start button and clicking on YourAppName. 17. As with the deployed version, nothing happens.

Steps to Fix Deployment Bug 18. Right click on the project name and click Edit Project File 19. Add the following property to the <PropertyGroup> element: <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> 20. Right click on the project name, and click Deploy 21. Double Click the YourAppName.exe file. 22. Now the app runs correctly.

Steps to Reproduce Second Publishing Bug 23. Repeat steps 11 to 15 24. This time, running the Setup gives an error message: “Cannot continue. The application is improperly formatted. Contact the application vendor for assistance.” 25. Click on the “Details” button, which opens the log file. The informative part of this file states: “Exception reading manifest from <my app path>.dll.manifest: the manifest may not be valid or the file could not be opened.” This log file is attached. 26. Open the manifest file and observe that it is an extremely large file, and it is not clear which part is the problem (GitHub will not let me attach this).

FJEXNEJX.log

Expected behavior

The installed app to behave in the same way as the deployed app.

Screenshots

No response

NuGet package version

None

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

About this issue

Most upvoted comments

I am so frustrated that this issue is not solved yet. If you do not want to solve the basic problem then close this project.

@JesseCol You can also reproduce this issue by following the steps given below-

  1. Open Visual Studio 2022
  2. Click “Create a new project”
  3. Select “Blank App Packaged (WinUI 3 in Desktop)”
  4. Click Next
  5. Click Create
  6. Click Run, and observe that the project runs successfully
  7. Now, select Release instead of Debug and Run again. You will find that the app did not run because of an unknown exception
  8. Now, If you choose “Package and Publish | Create App Packages…” you will successfully get an installer. Install it. But after installation you can not open up the app. Remember to choose Release mode while “Package and Publish | Create App Packages…”. In Debug mode it works good. But in Release mode it is not working
  9. Now, it is not good to Deploy app in Debug mode so I am so frustrated.

Please follow the steps and tell me what to do. I have already spent so much time to build a project now I have seen this issue. I am very disappointed.

I built a WinUI3 App and now I can’t published it to use the App on another computer 😣