While launching the WinUI application in unpackaged scenario the application icon is not shown in the TaskBar
Hello,
We are working on a WinUI application targeting .NET 8 and .NET 9, and our goal is to launch the app via the .exe directly.
To achieve this, we've updated our launchSettings.json and .csproj as follows:
In LaunchSettings.json
"profiles": {
"WinUIDemoSample (Package)": {
"commandName": "MsixPackage"
},
"WinUIDemoSample (Unpackaged)": {
"commandName": "Project"
}
}
**
In .csproj Configuration**
<AppxPackage>false</AppxPackage>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
Using this setup, the application successfully runs through the .exe in the unpackaged configuration. However, we're encountering the following issue:
Issue: The application icon is not visible in the taskbar.
We have tried adding the set application icon. manually, but still the icon is not shown in the taskbar and also by setting the window icon at runtime using both WM_SETICON and AppWindow.SetIcon(iconPath), and the icon shows correctly in the window title bar, but not in the taskbar.
Could you please confirm:
- Is this the correct and supported approach for running a WinUI 3 app as unpackaged via
.exe? (i.e., using<AppxPackage>false>and<WindowsAppSDKSelfContained>true>in.csproj) - Is there any known limitation or requirement for taskbar icon display in unpackaged WinUI 3 apps? (e.g., limitations due to lack of package identity, fallback to system/default icon behavior)
- Are there any recommended workarounds or additional configurations to ensure the taskbar icon is correctly rendered when running the app as unpackaged?
We would appreciate any guidance or documentation references that could help clarify this behaviour.
Thanks in advance!