Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: Share ViewModels

$
0
0
Hi again,

The problem was that the RepositoryBase class was not being registered in MEF. Please remember that to export a type in MEF you need to:
  • Add the Export attribute to the type you want to export,
  • And register the assembly containing the type so that MEF inspects it for any classes that need to be exported.
The problem was in the second point. As the Navigation.Repository assembly was not added as a AssemblyCatalog or initialized as a module the RepositoryBase class was not being exported. You can solve this by adding a reference to the Navigation.Repository project in the Navigation main project and including the following line in the ConfigureAggregateCatalog method of the bootstrapper:
this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(Repository.RepositoryBase).Assembly));
As a side note, this registration is not required when the project is loaded as a module by Prism, as it automatically registers the assembly to be inspected by MEF.

I hope this helps,

Damian Cherubini
http://blogs.southworks.net/dcherubini

Viewing all articles
Browse latest Browse all 1878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>