Search code examples
wpfxamlassembliesuriembedded-resource

How to use an embedded image of a separate assembly?


there are many related questions/answers about that in SO. I took a look to some of them but none really match.

An assembly (called ResourcesLoader) holds images as embedded ressources.

I would like to use these pictures in another assembly.

After looking at msdn pack uri, and seeing a lots of samples, I thought that the following line would do the job :

<Image Source="pack://application:,,,/ResourceLoader;component/Resource Files/Bitmaps/bmp20x20/Cancel.png" />

Guess what? It does not work! I have checked letter by letter several times to make sure there is no mistakes.

I tried with resource images and it worked. But I have to use embedded resources...

Who can give me the magical syntax? Thanks!


Solution

  • What is the build action set on this resource?. The Build Action should be Resource instead of Embedded Resource.