TypeDescriptor does not work with Mef RRS feed

  • Question

  • Hi,

    I have assembly loaded by mef. it contains class with custom typedescriptor.

    If the assembly is in the same folder as executing assembly, custom typedescriptor is loaded, but if I move it to my "Modules" folder, the typedescriptor won't initialize.

      public class CustomClass

          //load mefmodule
          var container = new CompositionContainer(new AssemblyCatalog("Modules/CustomObjectModule.dll"));
          ICustomClassModule module = container.GetExportedValue<ICustomClassModule>();
     var customClassInstance = module.GetCustomClassInstance();
    // TypeDescriptor.GetProperties(customClassInstance).Count == 0
    When I copy and paste CustomObjectModule.dll to executing assembly folder TypeDescriptor.GetProperties works properly and return 3 properties.

    I provided a sample project that demonstrates the problem: https://skydrive.live.com/redir?resid=51A46BBA4E9EF07E!1181

    Is there any workaround?
    • Moved by Bob Shen Friday, November 9, 2012 7:10 AM (From:Visual C# General)
    Thursday, November 1, 2012 11:54 AM

All replies