Querying metadata at the server side

May 5, 2010 at 5:26 PM

Hi,

This was originally posted on the msdn forum but it doesn't seem to get much traffic...

I have have a WCF service call to the server to enumerate the available Xaps that can be downloaded from the server using the DeploymentCatalog in Silverlight.  Currently I am just returning the name of the file back to the client.  I would like to also on the server side query the Xap for metadate information to get such things like an image for an icon, an ordinal to dictate the order that the plugin should show up in the silverlight UI etc.

Is this something I can use MEF to do? ie. Can I crack open the XAP from the server side to access this information?

I had looked at the Lazy<T, M> option but from what I can tell it needs to download the Xap from the server before it knows anything about the metadata from the different Xap files.   I want to avoid the download until the user explicitly needs to load that feature.  Correct me if I am wrong.

Cheers,

Clint

May 6, 2010 at 2:29 AM
You would have to rip open the XAP and then read the metadata using a metadata reader like cci.

Sent from my IPad.

On May 5, 2010, at 10:27 AM, "clintsinger" <notifications@codeplex.com> wrote:

From: clintsinger

Hi,

This was originally posted on the msdn forum but it doesn't seem to get much traffic...

I have have a WCF service call to the server to enumerate the available Xaps that can be downloaded from the server using the DeploymentCatalog in Silverlight. Currently I am just returning the name of the file back to the client. I would like to also on the server side query the Xap for metadate information to get such things like an image for an icon, an ordinal to dictate the order that the plugin should show up in the silverlight UI etc.

Is this something I can use MEF to do? ie. Can I crack open the XAP from the server side to access this information?

I had looked at the Lazy<T, M> option but from what I can tell it needs to download the Xap from the server before it knows anything about the metadata from the different Xap files. I want to avoid the download until the user explicitly needs to load that feature. Correct me if I am wrong.

Cheers,

Clint

May 6, 2010 at 3:27 PM

Thanks for the tip about the CCI.

It was covered in your reply so I will ask the question more specifically.  With respect to Lazy<T,M> does it only work with modules that have been downloaded or is there another trick that could coerce it into downloading the metadata from the server first then the module from server on demand?

Cheers,

Clint

P.S. I could really use some help with my other question titled "Recomposition error when removing a catalog?"; as I am not sure if it is a problem I am doing or a potential bug/known issue with mef.