0

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?

Yituo
  • 1,458
  • 4
  • 17
  • 26

2 Answers2

0

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

<Image  Height="20" Width="20" Margin ="10,0,5,0" Source="../Resources/myicon.ico">
</Image>
Vijay Kumbhoje
  • 1,401
  • 2
  • 25
  • 44
  • The path is correct I believe. The xaml file that uses the icon is in the same folder as Resource folder, and the icon is showing up correctly in the preview – Yituo Jun 23 '16 at 04:05
0

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.

Greg Trevellick
  • 1,361
  • 1
  • 16
  • 26