I try to display an image in a WPF based VSIX
in the XAML designer, the image appears fine
<Image x:Name="waitImage Source ="pack://application:,,,/wpf/Resources/progress_1.png" />
but programmatically, the API complains it needs the assembly name, so I load it this way
Assembly assembly = Assembly.GetExecutingAssembly();
string assemblyName = assembly.GetName().Name;
ImageAnimationPath = $"pack://application:,,,/{assemblyName};component/wpf/Resources/progress_{imageIndex}.png";
BitmapImage bitmapImage = new BitmapImage(new Uri(ImageAnimationPath));
imageIndex = (imageIndex % 3) + 1;
at runtime I get an error message :
"Cannot locate resource 'wpf/resources/progress_1.png'."
I expect:
- the image to load fine
- and be available at runtime when the VSIX is deployed or during debugging
I tried:
- properties/copy always on the image
- setting the Build action to Resource (the image disappears form the Solution explorer)
- cleaning the solution
Any help appreciated