I have a problem initializing MEF. I built an application that uses MEF and it seems to work fine on a WIndows 8 and Windows 7 SP1 machines. However, when I run the application on a third machine (windows 7 SP1) I get a ImportCardinalityMismatchException during the container.Compose method. I don't know why the application runs fine on two machines and on another it does not. Any suggestions? Here is my initialization:
private void ComposeMef()
{
var catalog = new AggregateCatalog(
new DirectoryCatalog("."),
new AssemblyCatalog(Assembly.GetExecutingAssembly()));
var batch = new CompositionBatch();
batch.AddPart(this);
_container = new CompositionContainer(catalog);
_container.Compose(batch);
}