5

I'm trying to set a custom icon for a specific file extension in the solution explorer in visual studio 2019. What do i need to add to the vsix project to make it happen?

I have tried to add a imagemanifest including the new icon as a .png file and in the pkgdef hook it up to the extension, but it will not show up. I tried a lot of different things to make it work. When i set an KnowMoniker as the icon for the extension it does show up.

The manifest is set to content and include in vsix is set to true. The icon is set to resource.

icon.imagemanifest

<?xml version="1.0" encoding="utf-8"?>
<ImageManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"        xmlns:xsd="http://www.w3.org/2001/XMLSchema"   xmlns="http://schemas.microsoft.com/VisualStudio/ImageManifestSchema/2014">
<Symbols>
    <String Name="Resources" Value="/Test;Component/Resources" />
    <Guid Name="Guid" Value="{35e0e52d-a955-451d-86e4-5813fef55368}" />
    <ID Name="icon" Value="1" />
</Symbols>
<Images>
    <Image Guid="$(Guid)" ID="$(icon)">
        <Source Uri="$(Resources)/icon.png">
            <Size Value="16" />
        </Source>
    </Image>
</Images>
<ImageLists />
</ImageManifest>

icon.pkgdef

[$RootKey$\ShellFileAssociations\.ext]
"DefaultIconMoniker"="35e0e52d-a955-451d-86e4-5813fef55368:1"
Richy
  • 71
  • 2
  • 1
    Maybe you can get some help from these similar issues([How to add custom icons to solution explorer](https://stackoverflow.com/questions/50896478/how-to-add-custom-icons-to-solution-explorer-in-visual-studio), [Custom File Type Icons](https://social.msdn.microsoft.com/Forums/vstudio/en-US/a535a72a-8953-430a-84e6-5618e488f7c3/custom-file-type-icons-in-solution-explorer-part-3?forum=vsx), ,) and [FileIcons Extension](https://github.com/madskristensen/FileIcons) – LoLance Jun 20 '19 at 05:53
  • Thnx, i already checked them out but as far as i can see i'm doing the exact same thing. I didn't try to install them to see if they work on VS 2019. I will give that a try. – Richy Jun 21 '19 at 06:13
  • Hi, any update for this issue? – LoLance Jun 25 '19 at 10:14
  • Hi, still the same problem. – Richy Jun 26 '19 at 11:02
  • related to https://stackoverflow.com/q/75481734/1539100 – sorosh_sabz Feb 17 '23 at 08:51

0 Answers0