This might sound a strange design to some. But this is what I am trying to do.
Assembly A Exports Part P.
Assembly A Imports Part P in one of its classes (note that same assembly exports it).
Assembly B is MEF Helper assembly which has a class that holds the CompositionContainer with all necessary catalogs.
A references B to call the MEF Helper classes.
The class in Assembly A that imports part P, calls on Assembly B's helper class; it calls the method FillMeWithParts(object target)
in the target parameter it provides this reference.
FillMeWithParts() is defined as follows
public void FillMeWithParts(object target) { //Fill the imports of this object try { this._container.ComposeParts(target); } catch (CompositionException compositionException) { Console.WriteLine(compositionException.ToString()); } catch (Exception Exception) { } }
Here is the problem. The parts aren't imported. The DirectoryCatalog supplied in Helper assembly (B) does have correct directory for Assembly A.
What could be the issue ?
Fahad