I have been playing around with the caching sample from the recent MEF 7 release and have partially got it working.
var testAssemblyCatalog =
var cachedAssemblyCatalog =
This example works fine, but the catalog I want to work with is a DirectoryCatalog that has 7 MEF dlls in it. I have tried the following code but it throws an error...
var testAggregateCatalog =
new DirectoryCatalog(Environment.CurrentDirectory) });
var cachedAggregateCatalog =
The error comes from the CachedAggregateCatalog.cs(149) after we try to cast the
ComposablePartCatalog as an ICachedComposablePartCatalog and it returns null.
foreach (ComposablePartCatalog catalog
ICachedComposablePartCatalog cachedCatalog = catalog
if (cachedCatalog ==
new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, Strings.CatalogIsNotCacheable, catalog.GetType()));
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Microsoft.Internal.Strings.resources" was correctly embedded or linked into assembly "Caching" at
compile time, or that all the satellite assemblies required are loadable and fully signed.
As far as i can tell this will never cast as it is the
CachedAggregateCatalog class that inherits the
ICachedComposablePartCatalog interface not the
ComposablePartCatalog class, which only inherits the
Is there another way to cache an aggregate catalog?
Thanks in advance