I am trying to create objects explicitely, similar to Spring ApplicationContext.getBean() method which creates objects with all the dependencies initialised within that object, I am not aware about MEF much , I tried searching web for the same but could not find the method to explicitely invoke creation of object with all its dependencies initialised,
Does anybody know the method which allows explicitely creating objects with all of its imports initialised ?
Thanks in advance,
Try
Where
compositionContaineris yourCompositionContainerinstance andExportedTypeis the type that you want to create/get an instance for.How can you get an instance of
CompositionContainer?Use the following code once:
Where
catalogis your MEF catalog (usually an instance ofAggregateCatalog).