0

In my WPF I set the application icon like below. Project property -> Application tab -> Resources Icon and manifest enter image description here

So I can see this icon on the wpf windows. but the icon of taskbar is default icon. How can I set it with application icon.

Application icon

enter image description here

Taskbar icon

enter image description here

JS Guru
  • 343
  • 1
  • 3
  • 11
  • 1
    I guess you didn't set the icon on the mainwindow. Or google before posting. https://www.technical-recipes.com/2016/setting-the-application-icon-in-wpf-xaml/ – Andy Dec 06 '19 at 15:54
  • @Andy I have already read this article before posting my question, it did not mention about taskbar icon but only application icon. – JS Guru Dec 06 '19 at 18:14
  • What @Andy is saying is that in mainwindow's properties you can set an icon for the window. Try that. If that doesn't work, run the executable that is generated and see if it shows correctly. – M W Dec 06 '19 at 19:37

2 Answers2

0

Setting the icon via XAML:

<Window
    ...
    Icon="nvicon.ico">
</Window>

Also be sure to build in release mode to double check your success, as there are some cases where a debug build does not apply icons (for reasons i do not know).

awoodhead
  • 87
  • 8
0

My project is the packaged application of WPF app. In Images folder of Windows Application Packaging App, there are several default images. enter image description here

I replaced them with my custom images.

enter image description here

So that I could resolve the task bar icon problem.

JS Guru
  • 343
  • 1
  • 3
  • 11