tags:

views:

81

answers:

1

Suppose I have following projects for silverlight application: MyApp: reference to MyLib MyLib: reference to MyImage MyImage

Following code will give me error(can't find out the object):

Application.GetResourceStream(new Uri("MyImage;component/myxml.xml", UriKind.Relative))

I need to add reference to MyImage in MyApp, the I can avoid the error, but MyLib already has reference to MyImage. How to modify the code to load the resource without the adding the duplicated reference in MyApp?

A: 

The code that you posted looks correct and should work.

Something to investigate. Go to the xap that is generated and open it as a zip file (e.g. rename it with a .zip extension). This will show the files that are in the xap. Two things to verify:

Is MyImage.dll being packaged into the xap?

Open AppManifest.xaml. Is MyImage.dll listed as an AssemblyPart? Does it have x:Name attribute of "MyImage"?

KeithMahoney