WunUI3 Deploy Failed: Blank Project Template Issue
In this article, we will discuss the issue of WunUI3 deploy failing, specifically when using a blank project template in Visual Studio 2022. This problem can occur in a brand new C++ WinUI 3 project, even without changing anything, after building and running locally.
Context and Key Concepts
WinUI 3 is the latest user interface framework for building Windows applications. It is a native, Windows-specific, and adaptive user interface toolkit. WinUI 3 separates the UI and the app logic, improving development productivity and flexibility.
Visual Studio 2022 is the latest IDE from Microsoft for building .NET, web, and mobile applications. With every update, new templates and features are added, ensuring developers can work with the latest technologies and tools.
WunUI3 Deploy Failed: The Issue
Creating a new C++ WinUI 3 project in Visual Studio 2022 might sometimes result in a deploy failure. The issue occurs when building and running the project locally without changing anything.
Reproducing the Issue
To reproduce this issue, open Visual Studio 2022 on a Windows 11 PC, enable developer mode, and create a new C++ WinUI 3 project. After building and running the project locally, the deploy might fail with the following error:
DEP0700 : Registration of the app failed. The AppxManifest.xml file, located under C:\<ProjectPath>\\bin\x64\Debug\AppX, is invalid or does not exist. Please check the logs for more details. (0x80073cf6)
WunUI3DeployFailed: Wunui3 deploy failed.
Please check the output window for more details and ensure that your project is a valid WinUI 3 Desktop application. Root Cause
The root cause of this issue is that the project template generated by Visual Studio 2022 has several missing components, including the AppxManifest.xml file and other necessary folders and files, leading to a failed deploy.
Solution
To solve the WunUI3 deploy failed issue, follow these steps:
In Visual Studio 2022, close the current project and create a new C++ WinUI 3 project.
Close Visual Studio 2022.
Navigate to the project directory and delete the following:
bin folder
obj folder
Reopen Visual Studio 2022 and build the project.
Run the project locally.
After following these steps, the deploy should complete successfully without any errors.
WinUI 3 is the latest user interface framework for building Windows applications.
Visual Studio 2022 is the latest IDE for building .NET, web, and mobile applications.
A blank C++ WinUI 3 project might encounter a deploy failure due to missing files or folders.
To solve this issue, clear out the bin and obj folders, and rebuild the project.