MEF is not an IoC container. But it seems that it is almost an IoC container. It seems that I can easily make MEF behave like an IoC container (see example below) and there is not much missing to make MEF a full blown IoC container.
What are the actual features that are missing in MEF that StrucureMap, Unity, etc. have to get on par?
Would you think, this feaure request makes sense?
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using System.Linq;
...
private CompositionContainer container;
public void Configure()
{
container = CompositionHost.Initialize(
new AggregateCatalog(
AssemblySource.Instance.Select(
x => new AssemblyCatalog(x)).OfType<ComposablePartCatalog>()));
var batch = new CompositionBatch();
batch.AddExportedValue<IWindowManager>(new WindowManager());
batch.AddExportedValue<IEventAggregator>(new EventAggregator());
batch.AddExportedValue(container);
container.Compose(batch);
}