简体   繁体   中英

Visual Studio Extension icon from resource does not show up

I'm writing a visual studio extension that is using some icons in the Resource folder(Resource folder and XAML file in the same parent folder). When wring the XAML file, the icons shows up fine in the Design window, however, after installation of the extension the icons does not show up. I am referencing the icons in the following way:

<Image  Height="20" Width="20" Margin ="10,0,5,0" Source="Resources/myicon.ico">
</Image>

Why does this happen, and what can I do to avoid this?

give correct Source path or just add "../" try this

<Image  Height="20" Width="20" Margin ="10,0,5,0" Source="../Resources/myicon.ico">
</Image>

I've a feeling the icon has to be 19 x 19, and possibly a .PNG too, although I wouldn't swear to either of these.

That said, have a look at the code at https://github.com/madskristensen/FileDiffer - this is a simple, published extension with icons.

There's also this video https://channel9.msdn.com/Events/Build/2016/B886 which is a walk-through of creating the above extension, which has a few mentions regarding icons.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM