Extract module resource using Pack URI

Oct 4, 2008 at 2:22 AM
Hi, I'm trying to extract an image from a module using Pack URI syntax e.g. image.Source = new BitmapImage(new Uri("/HelloWorld;component/Clock.ico", UriKind.Relative));

This works correctly when HelloWorld.dll and MyApp.exe are in the same folder, but when HelloWorld.dll is located at /bin/debug/Modules/HelloWorld.dll it doesn't work.

MSDN docs say format for Pack URI is: AssemblyShortName[;Version][;PublicKey];component/Path.
Is there any way to say that the AssemblyShortName is in a subfolder?

Oct 6, 2008 at 9:14 PM
Edited Oct 6, 2008 at 9:16 PM
I have found a solution, with some minor updates to the CAL : )

To IModule interface added
 Image GetModuleImage();


and to IModuleLoader interface added
 IModule GetModule(ModuleInfo moduleInfo);

The GetModuleImage method uses the pack uri syntax to create an image.
The GetModule method allows me to call from my shell into the module to get the image.