Silverlight 3 Application Library Caching?

Feb 18, 2010 at 4:35 AM

I found that if I enable Silverlight 3 Application Library Caching and create extmap files for System.ComponentModel.Composition.dll and System.ComponentModelComposition.Initialization.dll, I get a MEF error.  If I disable application library caching the app works fine.

Should MEF work with App Library caching?

The app runs fine without application library caching.

Here are some details of the error:

System.ComponentModel.Composition.ChangeRejectedException was unhandled by user code

  Message="The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.\r\n\r\n1) No valid exports were found that match the constraint '((exportDefinition.ContractName = \"Log\") &&

Feb 18, 2010 at 3:54 PM

So MEF should work when using App library caching/Transparent Platform Extensions (TPE) for System.ComponentModel.Compostion*. The error you are getting shows me that MEF is actually loading itself but it appears as though some other dependency is missing. Are you turning on Application Library Caching for other assemblies that have exports/imports in them? Also which catalog are you using or are you using PartInitializer? I ask because the by default the catalog will only contain exports that are actually in the XAP and not referenced as External Parts (i.e. App Library caching) in the AppManifest.