How to set a custom icon for a file extension which shows up in the solution explorer

Viewed 696

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"
0 Answers
Related