1

I'm building a simple Winforms application that deploys via msi (Visual Studio setip project). The msi creates a shortcut on the users desktop and the start menu.

Everywhere (desktop, start menu, taskbar when program is running, .exe file) the program icon is displayed correctly.

But not when I type the program name in the start menu search (see screenshot below). There some generic icon is displayed.

I quadruple-checked the icon set in Visual Studio > Winforms Project > Properties > Application and the icon for the shortcut set via the Visual Studio setup project. The .ico file has many different resolutions embedded, up to 512x512px. Since it's working fine everywhere else (except in the search) I can't think of anything als I could try.

Wrong icon in search

Hannes Sachsenhofer
  • 1,835
  • 1
  • 23
  • 38
  • 2
    Explorer caches icons, so if it ever saw your program before you gave it an icon then you are liable to see the old icon from the cache. Testing this on another machine is always best. Backgrounder [is here](https://stackoverflow.com/a/46844296/17034). – Hans Passant Nov 16 '17 at 09:32
  • Thank you, Hans. I already tried to clear the icon cache, to no avail. I'll try it with a clean Win10 VM next. Thanks again. – Hannes Sachsenhofer Nov 16 '17 at 09:58

1 Answers1

0

Hans' comment was the solution for me. It seems that Windows caches the old/wrong icon. When I tried it on a clean Windows 10, it worked immediately.

Of course, I tried to clear the icon caches according to Application icon is blank when started from Process.Start or the script at http://www.winhelponline.com/blog/how-to-rebuild-the-icon-cache-in-windows but this did not work on my machine (even with a lot of restarts and killing of explorer.exe).

Hannes Sachsenhofer
  • 1,835
  • 1
  • 23
  • 38