Dear All,
I am trying to get the IRenameService through the following way of MEF import:
public class ServiceArchive
{
[Import]
public IRenameService RenameService { get; set; }
private static ServiceArchive instance;
private void compose()
{
var catalog = new AssemblyCatalog(Assembly.GetAssembly(typeof(IRenameService)));
var container = new CompositionContainer(catalog);
container.ComposeParts(this);
}
public static ServiceArchive GetInstance()
{
if (instance == null)
{
instance = new ServiceArchive();
instance.compose();
}
return instance;
}
}
However, the renameService field is always null. Do you have any idea about why that?
Thanks!
Xi