I can't solve what seems to be a basic MEF problem: I have 2 "plugins" project (which we'll call P1 and P2), and a third project that is common to both plugins (which we'll call C). P1 and P2 both reference C.
When trying to import a component that lives in P1, it fails because this component has dependencies on components that live in C.
Here is the trace:
System.ComponentModel.Composition Warning: 1 : The ComposablePartDefinition 'MyCompany.Client.Pms.Plugin.InclusionList.ViewModel.InclusionListViewModel' has been rejected. The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced multiple composition errors, with 4 root causes. The root causes are provided below. Review the CompositionException.Errors property for more detailed information.
1) No exports were found that match the constraint '((exportDefinition.ContractName = "MyCompany.Client.Plugins.Common.Controls.Selectors.PortfolioSelectors.ViewModel.ICalypsoBookSelectorViewModel") && (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") && "MyCompany.Client.Plugins.Common.Controls.Selectors.PortfolioSelectors.ViewModel.ICalypsoBookSelectorViewModel".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'MyCompany.Client.Pms.Plugin.InclusionList.ViewModel.InclusionListViewModel.CalypsoBookSelectorViewModel (ContractName="MyCompany.Client.Plugins.Common.Controls.Selectors.PortfolioSelectors.ViewModel.ICalypsoBookSelectorViewModel")' on part 'MyCompany.Client.Pms.Plugin.InclusionList.ViewModel.InclusionListViewModel'. Element: MyCompany.Client.Pms.Plugin.InclusionList.ViewModel.InclusionListViewModel.CalypsoBookSelectorViewModel (ContractName="MyCompany.Client.Plugins.Common.Controls.Selectors.PortfolioSelectors.ViewModel.ICalypsoBookSelectorViewModel") --> MyCompany.Client.Pms.Plugin.InclusionList.ViewModel.InclusionListViewModel --> DirectoryCatalog (Path="C:\Work\mmtrader\dashboard\Code\Src\Dashboard\MM\Trader\bin\Debug\Plugins\Positions")
[...] (The 3 other problems are exactly the same, on different view models)
I have looked at the MEF catalog, and it turns out that MEF knows about those view models, so I don't know what's missing.
As requested by Dennis below, here are my import/export:
Export:
Export(typeof(ICalypsoBookSelectorViewModel))]
public class CalypsoBookSelectorViewModel : ScreenWithCleanupLifecycle, ICalypsoBookSelectorViewModel
{...}
Import:
[Import(typeof(ICalypsoBookSelectorViewModel))]
public ICalypsoBookSelectorViewModel CalypsoBookSelectorViewModel { get; set; }
And the catalog:

Thanks in advance for your help!