May 8, 2014 at 6:26 PM
Edited May 8, 2014 at 6:27 PM
i have a composite application that loads dynamically an external assembly using prism 5 and MEF, the module contains an image, how can i show this image on my shell?
The module is loaded dynamically by using DirectoryCatalog and it's not referenced on the start-up project.
i tried the following but it doesn't work:
<Image Source="pack://application:,,,/MyDllFileName;component/Images/icon.png" />
<Image Source="/MyDllFileName;component/Images/icon.png" />
how can i solve this problem please?
I have tried to reproduce your problem, but both approaches you mentioned worked successfully on my solution.
execution, you would not need any other implementation rather than the
control definition in the Shell
View. If you would like to see the image in DesignTime
instead, you would need to additionally reference the external assembly on the specific project.
Anyway, regarding your problem I would suggest you to verify the external assembly location:
- Assembly file should be placed on the Debug or
Release folder where the solution builds and runs.
- The path of the image inside the assembly would be relative to the root assembly. So if you have the
Image folder placed on the root of the project assembly, the source path would be as you correctly described.
if this did not help you, it would be helpful if you could explain what in particular would not work.
Thanks a lot
The problem was in my the property AssemblyName, it returns the assembly name with the extension .dll
I solved the problem by using the function Path.GetFileNameWithoutExtension()