Can't set icon in Taskbar

Bert Boonstra 26 Reputation points
2022-06-24T09:36:09.647+00:00

Hi,

I'm developing my first WinUI 3 app using the WindowsAppSDK. My struggle is with setting the icon for the app and in the Windows Taskbar.
Setting the icon for the main window works well with the 'SetIcon' method of the AppWindow instance. But I can't get it onto the Taskbar, not from the manifest or from code.

I have also tried the AppWindow sample on GitHub (https://github.com/nickrandolph/AppWindowSample), but with same result.

Any ideas what could be the cause of the issue here? Are there special requirements for the icon? (my expertise is mostly in Windows Forms so it is very well possible that I have missed something here). My Windows version is 11.

Windows development | Windows App SDK
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Shirai_Kuroko 26 Reputation points
    2023-01-05T07:23:34.863+00:00

    You can go to the "Package.appxmanifest", switch to visual properties and generate those icon pngs and then change their build option to content.Then you will see the icon on taskbar.This worked for me

    1 person found this answer helpful.
    0 comments No comments

  2. Castorix31 90,686 Reputation points
    2022-06-24T10:07:26.783+00:00

    It is in Properties, Win32 Resources (this had been asked : App Icon - Windows App SDK)


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.